body {
    margin: 0;
    font-family: 'Amiri', serif;
    background: linear-gradient(to bottom, #e8f5e9, #bbdefb, #f9e79f);
    transition: background 0.5s, color 0.5s;
    color: #333;
    overflow-x: hidden;
}

body.dark {
    background: linear-gradient(to bottom, #1a3c34, #0d2b4e, #8b4513);
    color: #f0e8d4;
}

.container {
    text-align: center;
    padding: 50px 20px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #8b4513;
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.3);
    font-weight: 700;
}

body.dark h1 {
    color: #f0e8d4;
    text-shadow: 2px 2px 4px rgba(240, 232, 212, 0.3);
}

h2 {
    font-size: 1.3rem;
    color: #6d4c41;
    margin-bottom: 40px;
    font-weight: 400;
}

body.dark h2 {
    color: #c4a484;
}

.mood-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.mood-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.4s, box-shadow 0.4s, background 0.4s;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    color: #fff;
    font-family: 'Amiri', serif;
    width: 150px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mood-btn i {
    font-size: 1.2rem;
}

.mood-btn[data-mood="السعادة"] { background: #6d4c41; }
.mood-btn[data-mood="القلق"] { background: #0288d1; }
.mood-btn[data-mood="الوحدة"] { background: #78909c; }
.mood-btn[data-mood="الشكر"] { background: #f9a825; color: #333; }
.mood-btn[data-mood="الحزن"] { background: #5e35b1; }
.mood-btn[data-mood="الغضب"] { background: #d32f2f; }

.mood-btn:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

#random-verse-btn {
    padding: 12px 25px;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.4s, transform 0.4s;
    font-family: 'Amiri', serif;
    margin: 20px 0;
    font-size: 1.1rem;
}

#random-verse-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

#result {
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: opacity 0.5s;
    max-width: 600px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

body.dark #result {
    background: rgba(26, 60, 52, 0.7);
}

#result h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    transition: color 0.3s;
}

body.dark #result h3 {
    color: #c4a484;
}

#verse {
    font-size: 1.5rem;
    margin: 20px 0;
    color: #2f4f4f;
    line-height: 1.8;
    text-align: center;
    padding: 10px;
    border-left: 4px solid #6d4c41;
    border-radius: 5px;
    font-family: 'Amiri Quran', serif;
    animation: fadeIn 1s ease-in-out;
}

body.dark #verse {
    color: #f0e8d4;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.audio-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.audio-timeline {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: background 0.3s;
}

body.dark .audio-timeline {
    background: #2a3b3a;
}

.audio-timeline button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    padding: 0;
    width: 20px;
    height: 20px;
    transition: color 0.3s;
}

body.dark .audio-timeline button {
    color: #ccc;
}

.audio-timeline #rewind-audio:hover,
.audio-timeline #volume-control:hover {
    color: #000;
}

body.dark .audio-timeline #rewind-audio:hover,
body.dark .audio-timeline #volume-control:hover {
    color: #fff;
}

#audio-progress {
    flex-grow: 1;
    height: 8px;
    background: linear-gradient(to right, #e0e0e0, #d0d0d0);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.3s;
}

body.dark #audio-progress {
    background: linear-gradient(to right, #444, #555);
}

#progress-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(to right, #4caf50, #66bb6a);
    width: 0;
    border-radius: 4px;
    transition: width 0.1s linear;
}

body.dark #progress-bar {
    background: linear-gradient(to right, #81c784, #a5d6a7);
}

#progress-thumb {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid #4caf50;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.3s, background 0.3s;
    z-index: 10;
}

body.dark #progress-thumb {
    background: #2a3b3a;
    border-color: #81c784;
}

#progress-thumb:hover {
    transform: translateY(-50%) scale(1.2);
    border-color: #388e3c;
    background: #e8f5e9;
}

body.dark #progress-thumb:hover {
    border-color: #66bb6a;
    background: #1a3c34;
}

#progress-thumb:active {
    transform: translateY(-50%) scale(1.1);
}

#current-time, #duration {
    font-size: 0.9rem;
    color: #666;
    min-width: 40px;
    text-align: center;
    font-weight: 500;
}

body.dark #current-time, body.dark #duration {
    color: #ccc;
}

.audio-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#play-audio, #stop-audio, #share-verse {
    padding: 12px;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.4s, transform 0.4s;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#play-audio {
    background: #4caf50;
}

#play-audio:hover {
    background: #45a049;
    transform: translateY(-2px);
}

#stop-audio {
    background: #d32f2f;
}

#stop-audio:hover {
    background: #b71c1c;
    transform: translateY(-2px);
}

#share-verse {
    background: #0288d1;
}

#share-verse:hover {
    background: #01579b;
    transform: translateY(-2px);
}

#social-menu {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    padding: 10px;
    z-index: 1000;
}

#social-menu a {
    display: block;
    margin: 5px 0;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
}

#social-menu a i {
    margin-left: 5px;
}

.hidden {
    display: none;
    opacity: 0;
}

.divider {
    width: 90%;
    margin: 30px auto;
    border: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #6d4c41, transparent);
}

body.dark .divider {
    background: linear-gradient(to right, transparent, #c4a484, transparent);
}

footer {
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.05);
}

body.dark footer {
    background: rgba(0, 0, 0, 0.2);
}

footer p {
    font-size: 0.9rem;
    color: #6d4c41;
    margin-bottom: 10px;
}

body.dark footer p {
    color: #c4a484;
}

.social-links a {
    margin: 0 20px;
    font-size: 1.8rem;
    color: #0288d1;
    transition: color 0.4s, transform 0.4s;
}

body.dark .social-links a {
    color: #4fc3f7;
}

.social-links a:hover {
    color: #01579b;
    transform: scale(1.3);
}

body.dark .social-links a:hover {
    color: #29b6f6;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #f9a825;
    transition: color 0.5s;
}

body.dark .theme-toggle {
    color: #f0e8d4;
}

.theme-toggle i {
    transition: transform 0.5s;
}

body.dark .theme-toggle i {
    transform: rotate(180deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .mood-btn {
        width: 130px;
        height: 55px;
        font-size: 1rem;
    }

    #verse {
        font-size: 1.3rem;
    }

    #result {
        padding: 20px;
    }

    .audio-timeline {
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .mood-btn {
        width: 120px;
        height: 50px;
        font-size: 0.9rem;
    }

    #verse {
        font-size: 1.2rem;
    }

    .theme-toggle {
        font-size: 1.5rem;
    }

    #random-verse-btn {
        font-size: 1rem;
        padding: 10px 20px;
    }

    .audio-timeline {
        max-width: 250px;
    }

    #play-audio, #stop-audio, #share-verse {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    #social-menu {
        bottom: 60px;
        width: 150px;
        font-size: 0.9rem;
    }

    #progress-thumb {
        width: 14px;
        height: 14px;
        right: -7px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 80px 40px;
    }

    .mood-buttons {
        gap: 30px;
    }

    #result {
        max-width: 800px;
    }

    #verse {
        font-size: 1.8rem;
    }

    .audio-timeline {
        max-width: 500px;
    }
}
