/* CSS Variables with Fallbacks */


      .lesson-container {
        max-width: 1000px;
        margin: 0 auto;
        padding: 2rem 1rem;
      }

      .lesson-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: var(--radius-lg);
        padding: 3rem 2rem;
        margin: 2rem 0;
        text-align: center;
        box-shadow: var(--shadow-lg);
        position: relative;
        overflow: hidden;
      }

      .lesson-header::before {
        content: "🌍🗺️🌎🌏✈️";
        position: absolute;
        font-size: 4rem;
        top: -20px;
        left: -50%;
        width: 200%;
        height: 120%;
        opacity: 0.1;
        animation: float 25s ease-in-out infinite;
      }

      @keyframes float {
        0%,
        100% {
          transform: translateY(0px) rotate(0deg);
        }
        50% {
          transform: translateY(-30px) rotate(5deg);
        }
      }

      .lesson-title {
        font-family: var(--font-family-brand);
        font-size: clamp(2rem, 5vw, 3rem);
        font-weight: var(--font-weight-bold);
        margin-bottom: 1rem;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
        position: relative;
        z-index: 1;
      }

      .lesson-subtitle {
        font-size: 1.25rem;
        margin-bottom: 2rem;
        opacity: 0.9;
        position: relative;
        z-index: 1;
      }

      .lesson-section {
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        padding: 2rem;
        margin: 2rem 0;
        box-shadow: var(--shadow-sm);
        transition: all var(--transition-normal);
      }

      .lesson-section:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
      }

      .section-title {
        font-family: var(--font-family-brand);
        font-size: 1.75rem;
        font-weight: var(--font-weight-semibold);
        color: var(--primary-color);
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        gap: 1rem;
      }

      .section-icon {
        font-size: 2rem;
      }

      /* Enhanced Country Cards */
      .country-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        margin: 2rem 0;
      }

      .country-card {
        background: linear-gradient(145deg, #f8fafc, #e2e8f0);
        border: 2px solid #cbd5e1;
        border-radius: 15px;
        padding: 1.5rem;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
      }

      .country-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        border-color: var(--primary-color);
      }

      .country-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(
          90deg,
          transparent,
          rgba(255, 255, 255, 0.4),
          transparent
        );
        transition: left 0.5s;
      }

      .country-card:hover::before {
        left: 100%;
      }

      .flag-emoji {
        font-size: 5rem;
        margin: 0.5rem auto 1rem;
        display: block;
        filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
        transition: transform 0.3s ease;
      }

      .country-card:hover .flag-emoji {
        transform: scale(1.2) rotate(5deg);
      }

      .country-name {
        font-size: 1.5rem;
        font-weight: var(--font-weight-bold);
        color: var(--primary-color);
        margin-bottom: 1rem;
      }

      .country-info {
        color: var(--text-secondary);
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        font-size: 1rem;
        line-height: 1.5;
      }

      .country-card.revealed .country-info {
        opacity: 1;
        max-height: 300px;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 2px solid var(--primary-color);
      }

      .capital-info {
        font-weight: bold;
        color: var(--primary-color);
        margin-bottom: 0.5rem;
      }

      .fun-fact {
        font-style: italic;
        color: var(--secondary-color);
        margin-top: 0.75rem;
        background: rgba(16, 185, 129, 0.1);
        padding: 0.75rem;
        border-radius: 8px;
        border-left: 3px solid var(--secondary-color);
      }

      .click-hint {
        font-size: 0.875rem;
        color: var(--accent-color);
        font-style: italic;
        margin-top: 0.75rem;
        opacity: 0.7;
        animation: pulse 2s infinite;
      }

      .country-card.revealed .click-hint {
        opacity: 0;
        display: none;
      }

      @keyframes pulse {
        0%,
        100% {
          opacity: 0.7;
        }
        50% {
          opacity: 1;
        }
      }

      /* Game Sections */
      .game-section {
        background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
        border-radius: var(--radius-lg);
        padding: 2rem;
        margin: 2rem 0;
        box-shadow: var(--shadow-md);
        border: 2px solid #f59e0b;
      }

      .matching-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 2rem 0;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
      }

      .match-item {
        background: #fff;
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        padding: 1rem;
        font-size: 1.1rem;
        font-weight: bold;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        user-select: none;
      }

      .match-item:hover {
        transform: scale(1.05);
        border-color: var(--primary-color);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      }

      .match-item.selected {
        background: var(--accent-color);
        color: white;
        transform: scale(1.05);
      }

      .match-item.matched {
        background: var(--secondary-color);
        color: white;
        transform: scale(0.95);
        pointer-events: none;
      }

      /* Progress Tracking */
      .progress-section {
        background: #f0f9ff;
        border: 2px solid #0ea5e9;
        border-radius: 12px;
        padding: 1.5rem;
        margin: 2rem 0;
        text-align: center;
      }

      .progress-bar {
        width: 100%;
        height: 20px;
        background: #e2e8f0;
        border-radius: 10px;
        overflow: hidden;
        margin: 1rem 0;
      }

      .progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #10b981, #059669);
        width: 0%;
        transition: width 0.5s ease;
        border-radius: 10px;
      }

      /* Map Quiz Section */
      .map-section {
        background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
        border-radius: var(--radius-lg);
        padding: 2rem;
        margin: 2rem 0;
        box-shadow: var(--shadow-md);
        text-align: center;
        border: 2px solid #3b82f6;
      }

      .continent-map-container {
        background: white;
        border-radius: 12px;
        padding: 2rem;
        margin: 2rem auto;
        max-width: 800px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }

      .continent-map-container img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      }

      /* Pronunciation Practice Section */
      .pronunciation-section {
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
        border-radius: var(--radius-lg);
        padding: 2rem;
        margin: 2rem 0;
        box-shadow: var(--shadow-md);
        border: 2px solid #f59e0b;
      }

      .pronunciation-card {
        background: white;
        border-radius: 12px;
        padding: 2rem;
        margin: 1.5rem 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      }

      .pronunciation-sentence {
        font-size: 1.3rem;
        line-height: 2;
        color: #1f2937;
        margin: 1rem 0;
        font-weight: 500;
      }

      .highlight-s {
        color: #dc2626;
        font-weight: bold;
        font-size: 1.4em;
        text-decoration: underline;
        text-decoration-color: #fca5a5;
        text-decoration-thickness: 2px;
      }

      .highlight-r {
        color: #2563eb;
        font-weight: bold;
        font-size: 1.4em;
        text-decoration: underline;
        text-decoration-color: #93c5fd;
        text-decoration-thickness: 2px;
      }

      .practice-btn {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: white;
        border: none;
        border-radius: 8px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
        margin: 0.5rem;
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
      }

      .practice-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
      }

      /* Hidden Answer/Reveal Functionality */
      .answer-container {
        background: #f3f4f6;
        border-radius: 8px;
        padding: 1rem;
        margin: 1rem 0;
        position: relative;
        overflow: hidden;
      }

      .answer-hidden {
        filter: blur(8px);
        user-select: none;
        transition: filter 0.3s ease;
      }

      .answer-revealed {
        filter: blur(0);
        animation: revealAnswer 0.5s ease;
      }

      @keyframes revealAnswer {
        0% {
          opacity: 0;
          transform: scale(0.95);
        }
        100% {
          opacity: 1;
          transform: scale(1);
        }
      }

      .reveal-btn {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        border: none;
        border-radius: 8px;
        padding: 0.5rem 1.5rem;
        font-size: 0.95rem;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-top: 0.5rem;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
      }

      .reveal-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
      }

      .reveal-btn.revealed {
        background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
      }

      .continent-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        margin: 1.5rem 0;
      }

      .continent-btn {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: #fff;
        border: none;
        border-radius: 25px;
        padding: 0.75rem 1.5rem;
        font-size: 1.1rem;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
      }

      .continent-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
      }

      .quiz-output {
        font-size: 1.5rem;
        font-weight: bold;
        margin-top: 2rem;
        color: var(--primary-color);
        min-height: 3rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 15px;
        padding: 1.5rem;
        border: 2px dashed var(--primary-color);
      }

      /* Sound Effects Button */
      .sound-btn {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
        margin-left: 1rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
      }

      .sound-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
      }

      /* Language Section */
      .language-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        margin: 1.5rem 0;
      }

      .language-card {
        background: white;
        border: 2px solid #e5e7eb;
        border-radius: 10px;
        padding: 1rem;
        text-align: center;
        transition: all 0.3s ease;
      }

      .language-card:hover {
        transform: translateY(-5px);
        border-color: var(--primary-color);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
      }

      /* Accessibility: Skip Link */
      .skip-link:focus {
        position: fixed;
        top: 10px;
        left: 10px;
        background: var(--primary-color);
        color: white;
        padding: 0.75rem 1.5rem;
        border-radius: 8px;
        text-decoration: none;
        font-weight: bold;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 9999;
      }

      /* Enhanced Focus States */
      .country-card:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 3px;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
      }

      .continent-btn:focus,
      .sound-btn:focus,
      button:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
      }

      .match-item:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
      }

      /* Reduced Motion */
      @media (prefers-reduced-motion: reduce) {
        * {
          animation-duration: 0.01ms !important;
          animation-iteration-count: 1 !important;
          transition-duration: 0.01ms !important;
        }
      }

      /* Responsive Design */
      @media (max-width: 768px) {
        .lesson-container {
          padding: 1rem;
        }

        .lesson-header {
          padding: 2rem 1rem;
        }

        .lesson-section {
          padding: 1.5rem;
        }

        .section-title {
          flex-direction: column;
          align-items: flex-start;
          gap: 0.5rem;
        }

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

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

        .continent-buttons {
          flex-direction: column;
        }

        .continent-btn {
          width: 100%;
        }
      }

      /* Print Styles */
      @media print {
        header,
        footer,
        .sound-btn,
        .game-section,
        .controls {
          display: none !important;
        }

        .lesson-container {
          padding: 0;
        }

        .country-card {
          page-break-inside: avoid;
        }

        .country-info {
          opacity: 1 !important;
          max-height: none !important;
        }
      }

/* Ensure mobile dropdowns work properly */
      @media (max-width: 768px) {
        /* FORCE mobile menu to display full width */
        .nav-links,
        #navLinks,
        ul.nav-links {
          display: flex !important;
          position: fixed !important;
          top: 70px !important;
          left: 0 !important;
          right: 0 !important;
          bottom: 0 !important;
          width: 100vw !important;
          height: auto !important;
          min-height: calc(100vh - 70px) !important;
        }

        .nav-links.active,
        #navLinks.active,
        ul.nav-links.active {
          display: flex !important;
          max-height: calc(100vh - 70px) !important;
          height: auto !important;
        }

        /* Make sure nav links with dropdowns are clearly tappable */
        .nav-item .nav-link {
          position: relative;
          user-select: none;
          -webkit-user-select: none;
          -webkit-tap-highlight-color: rgba(70, 187, 229, 0.2);
          cursor: pointer;
        }

        /* Ensure chevron is visible and clickable */
        .nav-link .fa-chevron-down {
          transition: transform 0.3s ease !important;
          opacity: 1 !important;
          pointer-events: none; /* Let clicks go through to parent link */
        }

        /* Visual feedback when dropdown is open */
        .nav-item.mobile-open > .nav-link,
        .nav-item.mobile-dropdown-open > .nav-link {
          background: rgba(70, 187, 229, 0.15) !important;
          border-color: var(--primary-color, #46bbe5) !important;
        }

        /* Make dropdowns smoother */
        .dropdown {
          transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            padding 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        }

        /* Ensure dropdown items are visible when parent is open */
        .nav-item.mobile-open .dropdown,
        .nav-item.mobile-dropdown-open .dropdown {
          display: block !important;
          visibility: visible !important;
          opacity: 1 !important;
          pointer-events: auto !important;
        }

        /* Ensure dropdown items are clickable */
        .dropdown-item,
        .dropdown > a {
          pointer-events: auto !important;
          touch-action: manipulation !important;
          user-select: none;
          -webkit-user-select: none;
        }
      }

