/* ==============================
   Variables & Reset
   ============================== */
:root {
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --secondary: #60a5fa;
    --accent: #facc15;
    --danger: #ef4444;
    --success: #10b981;
    --purple: #a855f7;

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-light: #f1f5f9;

    --text-main: #1e293b;
    --text-muted: #64748b;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);

    --radius: 16px;
    --transition: all 0.3s ease;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

.urdu-text {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-weight: 400;
    direction: rtl;
}

.highlight {
    color: var(--primary);
}

.container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==============================
   HEADER & NAV
   ============================== */
.header {
    background: #fff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 999;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 20px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    white-space: nowrap;
}

.logo i {
    color: var(--primary);
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-links li a:hover,
.nav-links li a.active {
    background: #f0fdf4;
    color: var(--primary-dark);
}

.nav-links li a.active {
    background: var(--primary);
    color: #fff;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-main);
    border-radius: 3px;
    transition: var(--transition);
}

/* ==============================
   BUTTONS
   ============================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-white {
    background: #fff;
    color: var(--primary-dark);
    border-color: #fff;
}

.btn-white:hover {
    background: #f0fdf4;
    transform: translateY(-2px);
}

/* ==============================
   PAGE HERO BANNERS
   ============================== */
.page-hero {
    padding: 60px 0 50px;
    text-align: center;
    color: #fff;
}

.page-hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.page-hero .urdu-text {
    font-size: 2rem;
    opacity: .85;
    margin-bottom: 12px;
    display: block;
}

.page-hero p {
    font-size: 1.1rem;
    opacity: .9;
    max-width: 600px;
    margin: 0 auto;
}

.bg-blue {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
}

.bg-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.bg-orange {
    background: linear-gradient(135deg, #f97316, #ef4444);
}

.bg-yellow {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.bg-purple {
    background: linear-gradient(135deg, #a855f7, #6366f1);
}

/* ==============================
   HERO (Home)
   ============================== */
.hero {
    padding: 80px 0;
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-text {
    flex: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    color: var(--primary-dark);
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 800;
    font-size: .9rem;
    margin-bottom: 20px;
}

.hero-text h1 {
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 18px;
}

.hero-text p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-btns {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 380px;
}

.floating-illustration {
    position: relative;
    width: 280px;
    height: 280px;
    background: linear-gradient(135deg, var(--secondary), #818cf8);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: morph 8s ease-in-out infinite alternate;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-lg);
}

.circle-blob {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
    z-index: 10;
}

.floating-icon {
    position: absolute;
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .15));
    animation: float 4s ease-in-out infinite;
}

.cap-icon {
    top: -15px;
    left: 15px;
    color: var(--accent);
    animation-delay: 0s;
}

.pen-icon {
    bottom: 15px;
    right: -15px;
    color: #fff;
    animation-delay: 1s;
}

.star-icon {
    top: 35px;
    right: -5px;
    font-size: 1.8rem;
    color: var(--accent);
    animation-delay: 2s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-18px)
    }
}

@keyframes morph {
    0% {
        border-radius: 40% 60% 70% 30%/40% 50% 60% 50%
    }

    100% {
        border-radius: 60% 40% 30% 70%/50% 60% 40% 50%
    }
}

/* ==============================
   FEATURE CARDS (Home)
   ============================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px 26px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 4px;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.feature-card p {
    font-size: .95rem;
    color: var(--text-muted);
    flex: 1;
}

.feature-link {
    font-weight: 800;
    color: var(--primary-dark);
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.feature-card:hover .feature-link {
    gap: 10px;
}

/* TIP BANNER */
.tip-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 50px 0;
    color: #fff;
}

.tip-content {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.tip-icon {
    font-size: 3rem;
    flex-shrink: 0;
    color: var(--accent);
}

.tip-content div {
    flex: 1;
}

.tip-content h3 {
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.tip-content p {
    font-size: 1.05rem;
    opacity: .9;
}

/* ==============================
   SECTIONS COMMON
   ============================== */
.section {
    padding: 70px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.section-title p {
    font-size: 1.05rem;
    color: var(--text-muted);
}

.subheading {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.subheading-desc {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.page-intro-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #eff6ff;
    border-left: 4px solid var(--secondary);
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 40px;
    font-size: 1rem;
    color: #1e3a5f;
}

.page-intro-box i {
    color: var(--secondary);
    font-size: 1.3rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
    gap: 16px;
    flex-wrap: wrap;
}

/* ==============================
   FLASHCARDS
   ============================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 26px;
    perspective: 1200px;
    margin-bottom: 16px;
}

.sound-card {
    height: 210px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(.4, .2, .2, 1);
    cursor: pointer;
}

.sound-card.flipped {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.card-front {
    background: var(--bg-card);
    border: 2px solid transparent;
    transition: var(--transition);
}

.sound-card:hover .card-front {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-back {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    transform: rotateY(180deg);
}

.card-front h3 {
    font-size: 3.8rem;
    font-weight: 900;
    color: var(--primary-dark);
    line-height: 1;
    margin-bottom: 8px;
}

.sound-example {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.flip-hint {
    font-size: .8rem;
    color: #94a3b8;
    margin-top: 8px;
    font-weight: 600;
}

.urdu-char {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 4.5rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 8px;
}

.card-back p {
    font-size: 1rem;
    font-weight: 700;
    opacity: .9;
}

/* ==============================
   ALPHABET TABLE
   ============================== */
.alpha-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.alpha-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.alpha-table thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.alpha-table thead th {
    padding: 16px 18px;
    text-align: left;
    font-size: 1rem;
    font-weight: 800;
}

.alpha-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background .2s;
}

.alpha-table tbody tr:hover {
    background: #f0fdf4;
}

.alpha-table tbody tr:last-child {
    border-bottom: none;
}

.alpha-table tbody td {
    padding: 12px 18px;
    vertical-align: middle;
}

.row-num {
    color: #94a3b8;
    font-weight: 700;
    font-size: .9rem;
    width: 40px;
}

.urdu-big {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 2rem !important;
    font-weight: 700;
    color: var(--primary-dark) !important;
    text-align: center;
    direction: rtl;
}

.harf-naam {
    font-weight: 700;
    color: var(--text-muted);
}

.roman-spell {
    font-family: 'Courier New', monospace;
    font-weight: 900;
    font-size: 1.1rem;
    color: #6366f1;
}

.misaal-td {
    font-size: .95rem;
    color: var(--text-muted);
}

/* ==============================
   MISTAKES
   ============================== */
.mistakes-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mistake-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    padding: 18px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    border-left: 4px solid #fee2e2;
}

.mistake-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.mistake-item.is-correct {
    border-left-color: #d1fae5;
}

.mistake-num {
    width: 34px;
    height: 34px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: .9rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.wrong-side,
.right-side {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.right-side {
    justify-content: flex-start;
}

.wrong-word {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--danger);
}

.right-word {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary-dark);
}

.wrong-icon {
    color: var(--danger);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.right-icon {
    color: var(--success);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.arrow {
    color: var(--text-muted);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.reason {
    display: inline-block;
    background: #fee2e2;
    color: var(--danger);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-left: 8px;
}

.urdu-translation {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-left: 8px;
}

.meaning-badge {
    margin-left: auto;
    background: #f1f5f9;
    color: var(--text-muted);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ==============================
   DAILY EXERCISE
   ============================== */
.exercise-area {
    max-width: 680px;
    margin: 0 auto;
}

.exercise-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.progress-label,
.score-label {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.score-label {
    color: var(--primary-dark);
}

.progress-bar-wrap {
    flex: 1;
    height: 10px;
    background: #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 50px;
    transition: width .5s ease;
}

.exercise-card,
.exercise-complete {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 50px 44px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 2px solid #f0fdf4;
}

.ex-instruction {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.ex-urdu-word {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 14px 0 8px;
    line-height: 1.5;
}

.ex-hint {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 28px;
}

.ex-input-area {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.ex-input {
    flex: 1;
    min-width: 200px;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 700;
    outline: none;
    background: var(--bg-main);
    text-align: center;
    transition: var(--transition);
}

.ex-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .15);
    background: #fff;
}

.ex-result {
    margin-top: 18px;
    font-size: 1.2rem;
    font-weight: 800;
    min-height: 40px;
    padding: 10px 20px;
    border-radius: 12px;
    transition: var(--transition);
}

.ex-result.correct {
    background: #d1fae5;
    color: #065f46;
}

.ex-result.wrong {
    background: #fee2e2;
    color: #991b1b;
}

.ex-nav {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.complete-icon {
    font-size: 4rem;
    color: var(--accent);
    display: block;
    margin-bottom: 16px;
    animation: float 2s ease-in-out infinite;
}

.exercise-complete h2 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.exercise-complete h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.exercise-complete p {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 28px;
}

.complete-btns {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==============================
   QUIZ
   ============================== */
.quiz-meta {
    margin-bottom: 30px;
}

.quiz-progress-wrap {
    height: 10px;
    background: #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 12px;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), #6366f1);
    border-radius: 50px;
    transition: width .5s ease;
}

.quiz-stat-row {
    display: flex;
    gap: 24px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.quiz-area {
    max-width: 680px;
    margin: 0 auto;
}

.quiz-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 44px 40px;
    box-shadow: var(--shadow-lg);
}

.quiz-q-header {
    margin-bottom: 24px;
}

.quiz-q-urdu {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 2.5rem;
    direction: rtl;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.5;
}

.quiz-q-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.quiz-opt-btn {
    padding: 16px 20px;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 700;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-opt-btn:hover {
    background: #e2e8f0;
}

.quiz-opt-btn .opt-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 900;
    flex-shrink: 0;
    transition: var(--transition);
}

.quiz-opt-btn.selected-correct {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}

.quiz-opt-btn.selected-correct .opt-letter {
    background: var(--success);
    color: #fff;
}

.quiz-opt-btn.selected-wrong {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}

.quiz-opt-btn.selected-wrong .opt-letter {
    background: var(--danger);
    color: #fff;
}

.quiz-feedback-bar {
    margin-top: 16px;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    min-height: 30px;
}

#quiz-result-summary {
    margin: 20px 0;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-weight: 700;
}

.result-item.r-correct {
    background: #d1fae5;
    color: #065f46;
}

.result-item.r-wrong {
    background: #fee2e2;
    color: #991b1b;
}

/* ==============================
   FOOTER
   ============================== */
.footer {
    background: var(--text-main);
    color: #fff;
    padding: 60px 0 0;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-brand .logo {
    color: #fff;
    margin-bottom: 12px;
}

.footer-brand p {
    color: #94a3b8;
    font-size: .95rem;
}

.footer-links h4,
.footer-social h4 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: #e2e8f0;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links ul li a {
    color: #94a3b8;
    font-weight: 600;
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, .08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 20px 0;
    text-align: center;
    color: #64748b;
    font-size: .9rem;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .navbar {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: var(--shadow-lg);
        padding: 16px;
        z-index: 998;
    }

    .navbar.open {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        gap: 4px;
    }

    .nav-links li a {
        border-radius: 10px;
        padding: 10px 16px;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text p {
        margin: 0 auto 24px;
    }

    .hero-btns {
        justify-content: center;
    }

    .hero-image {
        height: 280px;
    }

    .hero-text h1 {
        font-size: 2.4rem;
    }

    .page-hero h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 8px;
    }

    .mistake-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .meaning-badge {
        margin-left: 0;
    }

    .arrow {
        transform: rotate(90deg);
    }

    .exercise-card,
    .exercise-complete {
        padding: 30px 20px;
    }

    .ex-urdu-word {
        font-size: 3rem;
    }

    .quiz-box {
        padding: 28px 20px;
    }

    .quiz-q-urdu {
        font-size: 2rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .nav-buttons {
        justify-content: center;
    }

    .tip-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    /* Exercise sidebar collapses on mobile */
    .ex-layout {
        flex-direction: column;
    }

    .ex-sidebar {
        width: 100%;
        max-height: 220px;
        overflow-y: auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding: 14px;
    }

    .sidebar-title {
        width: 100%;
    }

    .sidebar-level-label {
        width: 100%;
    }

    .sidebar-ex-btn {
        flex: 1 1 120px;
    }

    .ex-main {
        min-width: 0;
    }
}

/* ==============================
   DAILY EXERCISE LAYOUT
   ============================== */
.ex-layout {
    display: flex;
    align-items: flex-start;
    gap: 28px;
}

/* --- Sidebar --- */
.ex-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 20px 16px;
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title i {
    color: var(--primary);
}

.sidebar-level-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 10px;
    border-radius: 6px;
    margin: 8px 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-ex-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: left;
    transition: var(--transition);
}

.sidebar-ex-btn:hover {
    background: #f0fdf4;
    color: var(--primary-dark);
    border-color: #bbf7d0;
}

.sidebar-ex-btn.active {
    background: #f0fdf4;
    border-color: var(--primary);
    color: var(--primary-dark);
}

.sidebar-ex-btn.done {
    background: #f0fdf4;
    color: var(--primary-dark);
    opacity: 0.85;
}

.ex-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 900;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-ex-btn.active .ex-num {
    background: var(--primary);
    color: #fff;
}

.sidebar-ex-btn.done .ex-num {
    background: var(--success);
    color: #fff;
}

.ex-btn-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ex-btn-text small {
    font-size: 0.72rem;
    opacity: 0.7;
    font-weight: 600;
}

.ex-status {
    font-size: 0.9rem;
    color: #94a3b8;
}

.sidebar-ex-btn.done .ex-status {
    color: var(--success);
}

/* --- Main exercise area --- */
.ex-main {
    flex: 1;
    min-width: 0;
}

.ex-progress-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.prog-label {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.prog-score {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-dark);
    white-space: nowrap;
}

.ex-header-box {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: var(--radius);
    padding: 22px 28px;
    margin-bottom: 20px;
    border-left: 5px solid var(--primary);
}

.ex-header-box h2 {
    font-size: 1.6rem;
    font-weight: 900;
    margin: 6px 0 4px;
}

.ex-header-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.ex-level-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* Exercise Card */
.exercise-card,
.exercise-complete {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 2px solid #f0fdf4;
}

.ex-instruction {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.ex-urdu-word {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 3.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 14px 0 8px;
    line-height: 1.5;
}

.ex-hint {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 28px;
}

.ex-input-area {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.ex-input {
    flex: 1;
    min-width: 200px;
    padding: 13px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 700;
    outline: none;
    background: var(--bg-main);
    text-align: center;
    transition: var(--transition);
}

.ex-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .15);
    background: #fff;
}

.ex-result {
    margin-top: 18px;
    font-size: 1.15rem;
    font-weight: 800;
    min-height: 38px;
    padding: 10px 20px;
    border-radius: 12px;
    transition: var(--transition);
}

.ex-result.correct {
    background: #d1fae5;
    color: #065f46;
}

.ex-result.wrong {
    background: #fee2e2;
    color: #991b1b;
}

.ex-nav {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.complete-icon {
    font-size: 3.5rem;
    color: var(--accent);
    display: block;
    margin-bottom: 14px;
    animation: float 2s ease-in-out infinite;
}

.exercise-complete h2 {
    font-size: 1.9rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.exercise-complete p {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 24px;
}

.complete-btns {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}