:root {
    --primary-gradient: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    --secondary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-gradient: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --sidebar-gradient: linear-gradient(180deg, #1a2a6c 0%, #b21f1f 100%, #fdbb2d 100%);
    /* Deep Blue to Red/Orange */
    --sidebar-bg: #1a2a6c;

    --primary-color: #00b09b;
    --secondary-color: #667eea;
    --accent-color: #ff9f43;

    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --white: #ffffff;
    --border-color: #dfe6e9;

    --correct-color: #00b894;
    --wrong-color: #ff7675;

    --font-arabic: 'Amiri', serif;
    --font-bengali: 'Hind Siliguri', sans-serif;
    --font-main: 'Outfit', sans-serif;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.12);

    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: #2c3e50;
    /* Fallback */
    background: linear-gradient(to bottom, #0f2027, #203a43, #2c5364);
    color: var(--white);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.logo-area {
    padding: 2.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.logo-area i {
    font-size: 2.2rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-area h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #dfe6e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.surah-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.surah-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.surah-item {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.surah-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.surah-item.active {
    background: var(--primary-gradient);
    box-shadow: 0 8px 16px rgba(0, 176, 155, 0.3);
    border: none;
}

.surah-number {
    font-size: 0.9rem;
    opacity: 0.7;
    width: 30px;
    font-weight: 600;
}

.surah-name-en {
    flex: 1;
    font-weight: 600;
    font-size: 1.05rem;
}

.surah-name-ar {
    font-family: var(--font-arabic);
    font-size: 1.3rem;
    color: #ffd700;
}

.surah-item.active .surah-name-ar {
    color: #fff;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--bg-color);
}

.top-bar {
    height: 80px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 3rem;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.current-surah-info h2 {
    font-size: 1.5rem;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    margin-bottom: 4px;
}

.current-surah-info .subtitle {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 3rem;
    scroll-behavior: smooth;
}

/* Welcome Screen */
.welcome-screen {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.welcome-card {
    background: var(--white);
    padding: 4rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--primary-gradient);
}

.welcome-card i {
    font-size: 5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
}

.welcome-card h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-weight: 800;
}

.welcome-card p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Surah Display */
.hidden {
    display: none;
}

.bismillah {
    text-align: center;
    font-family: var(--font-arabic);
    font-size: 3rem;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4rem;
    margin-top: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.verse-container {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.verse-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.verse-container::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--secondary-gradient);
    opacity: 0.5;
}

.word-by-word {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: flex-start;
}

.word-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 12px 16px;
    border-radius: 16px;
    background: #f8f9fa;
    border: 2px solid transparent;
}

.word-block:hover {
    transform: scale(1.05);
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--secondary-color);
}

.word-block.playing {
    background: #e0f7fa;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 176, 155, 0.1);
}

.word-block.playing .word-ar {
    color: var(--primary-color);
    transform: scale(1.1);
}

.audio-icon {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-top: 8px;
    opacity: 0;
    transition: all 0.3s;
    transform: translateY(5px);
}

.word-block:hover .audio-icon,
.word-block.playing .audio-icon {
    opacity: 1;
    transform: translateY(0);
}

.word-ar {
    font-family: var(--font-arabic);
    font-size: 2.4rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    line-height: 1.6;
    transition: color 0.3s;
}

/* Tajweed-like styling for full arabic text */
.tajweed-text {
    font-family: var(--font-arabic);
    font-size: 2.2rem;
    line-height: 2;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #11998e, #38ef7d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.verse-translation {
    border-top: 2px dashed var(--border-color);
    padding-top: 2rem;
    text-align: center;
    margin-top: 1rem;
}

.verse-translation p {
    font-family: var(--font-bengali);
    font-size: 1.3rem;
    color: #4a4a4a;
    line-height: 1.8;
}

.verse-number {
    display: inline-block;
    background: var(--accent-gradient);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 10px rgba(253, 160, 133, 0.4);
}

.ayat-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.full-arabic-text {
    text-align: right;
    flex: 1;
    margin-bottom: 0;
}

.play-ayat-btn.icon-only {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 176, 155, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.play-ayat-btn.icon-only:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 176, 155, 0.4);
}

.play-ayat-btn.icon-only i {
    font-size: 1.2rem;
    margin: 0;
}

/* MCQ Section */
.mcq-section {
    margin-top: 5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    border: none;
    position: relative;
    overflow: hidden;
}

.current-surah-info {
    position: relative;
}

.play-all-btn {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 2rem;
    margin-top: -5px;
    width: 45px;
    height: 45px;
    background: var(--secondary-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.play-all-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.verse-container.highlight {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 176, 155, 0.2);
    background-color: #f0fffc;
    transform: scale(1.02);
}

/* Word Table Section */
.word-table-section {
    margin-top: 3rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}

.word-table-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    font-size: 1.5rem;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 0.5rem;
}

.word-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.word-table th,
.word-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.word-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-light);
}

.word-table td.arabic-cell {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    color: var(--primary-color);
}

.word-table tr:hover {
    background-color: #f8f9fa;
}

/* Header Extra Info */
.surah-header-extra {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.surah-type-badge {
    background: var(--accent-gradient);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.surah-meaning-text {
    font-style: italic;
}

.mcq-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--accent-gradient);
}

.mcq-header {
    text-align: center;
    margin-bottom: 3rem;
}

.mcq-header h3 {
    font-size: 2.2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.8rem;
    font-weight: 800;
}

.mcq-header p {
    font-size: 1.1rem;
    color: var(--text-light);
}

.mcq-card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
}

.mcq-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.question-text {
    font-family: var(--font-bengali);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.option-btn {
    padding: 1.2rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-bengali);
    font-size: 1.1rem;
    transition: all 0.2s ease;
    text-align: left;
    font-weight: 500;
    color: var(--text-dark);
}

.option-btn:hover {
    border-color: var(--secondary-color);
    background: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.option-btn.selected {
    border-color: var(--primary-color);
    background: #e0f7fa;
}

.option-btn.correct {
    background: var(--correct-color);
    color: white;
    border-color: var(--correct-color);
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
}

.option-btn.wrong {
    background: var(--wrong-color);
    color: white;
    border-color: var(--wrong-color);
    box-shadow: 0 4px 12px rgba(255, 118, 117, 0.3);
}

.quiz-feedback {
    margin-top: 1.2rem;
    font-weight: 700;
    font-family: var(--font-bengali);
    min-height: 28px;
    font-size: 1.1rem;
}

.feedback-correct {
    color: var(--correct-color);
}

.feedback-wrong {
    color: var(--wrong-color);
}

/* Mobile Responsiveness */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .sidebar {
        position: fixed;
        height: 100%;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .top-bar {
        padding: 0 1.5rem;
    }

    .content-scroll {
        padding: 1.5rem;
    }

    .word-by-word {
        justify-content: center;
    }

    .verse-container {
        padding: 1.5rem;
    }

    .word-ar {
        font-size: 2rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #b2bec3;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #636e72;
}