/* 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;
        }
      }

      /* Typing Test Specific Styles */
      .typing-container {
        background: white;
        padding: 2rem;
        border-radius: 12px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        margin-top: 2rem;
      }

      .typing-text {
        font-family: "Courier New", monospace;
        font-size: 1.3rem;
        line-height: 2;
        padding: 2rem;
        background: #f8f9fa;
        border-radius: 8px;
        margin-bottom: 1.5rem;
        min-height: 150px;
        user-select: none;
      }

      .typing-text .correct {
        color: #10b981;
        background: rgba(16, 185, 129, 0.1);
      }

      .typing-text .incorrect {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.2);
        text-decoration: underline;
      }

      .typing-text .current {
        background: #46bbe5;
        color: white;
        border-radius: 2px;
        animation: pulse 1s infinite;
      }

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

      #typingInput {
        width: 100%;
        padding: 1rem;
        font-family: "Courier New", monospace;
        font-size: 1.2rem;
        border: 2px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 1.5rem;
        transition: border-color 0.3s;
        resize: vertical;
        min-height: 120px;
      }

      #typingInput:focus {
        outline: none;
        border-color: #46bbe5;
        box-shadow: 0 0 0 3px rgba(70, 187, 229, 0.1);
      }

      #typingInput:disabled {
        background: #f3f4f6;
        cursor: not-allowed;
      }

      .progress-bar {
        height: 8px;
        background: #e5e7eb;
        border-radius: 10px;
        overflow: hidden;
        margin-bottom: 1.5rem;
      }

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

      .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
        margin-bottom: 1.5rem;
      }

      .stat-card {
        background: linear-gradient(135deg, #f8f9fa, #ffffff);
        padding: 1.5rem;
        border-radius: 8px;
        text-align: center;
        border: 2px solid #e5e7eb;
        transition: transform 0.3s, box-shadow 0.3s;
      }

      .stat-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }

      .stat-value {
        font-size: 2rem;
        font-weight: 700;
        color: #46bbe5;
        margin-bottom: 0.5rem;
      }



      .btn {
        flex: 1;
        min-width: 150px;
        padding: 1rem 2rem;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        text-decoration: none;
      }

      .btn-primary {
        background: linear-gradient(135deg, #46bbe5, #10b981);
        color: white;
      }

      .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(70, 187, 229, 0.4);
      }

      .btn-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
      }

      .btn-secondary {
        background: #f3f4f6;
        color: #374151;
        border: 2px solid #e5e7eb;
      }

      .btn-secondary:hover {
        background: #e5e7eb;
        transform: translateY(-2px);
      }

      .difficulty-selector {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 2rem;
        flex-wrap: wrap;
      }

      .difficulty-selector h3 {
        margin: 0;
        color: #374151;
      }

      .difficulty-btn {
        padding: 0.75rem 1.5rem;
        border: 2px solid #e5e7eb;
        border-radius: 8px;
        background: white;
        cursor: pointer;
        font-size: 1rem;
        font-weight: 600;
        transition: all 0.3s;
      }

      .difficulty-btn:hover {
        border-color: #46bbe5;
        transform: translateY(-2px);
      }

      .difficulty-btn.active {
        background: linear-gradient(135deg, #46bbe5, #10b981);
        color: white;
        border-color: transparent;
      }

      .results-container {
        display: none;
        background: linear-gradient(135deg, #46bbe5, #10b981);
        color: white;
        padding: 2rem;
        border-radius: 12px;
        margin-top: 2rem;
        animation: slideIn 0.5s ease;
      }


      .results-title {
        font-size: 2rem;
        font-weight: 700;
        text-align: center;
        margin-bottom: 1.5rem;
      }

      .results-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
      }

      .result-item {
        background: rgba(255, 255, 255, 0.2);
        padding: 1.5rem;
        border-radius: 8px;
        text-align: center;
        backdrop-filter: blur(10px);
      }

      .result-item h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        opacity: 0.9;
      }

      /* Main Layout */
      main {
        padding-top: 100px;
        padding-bottom: 3rem;
        min-height: calc(100vh - 200px);
      }

      main .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 1rem;
      }

      @media (max-width: 768px) {
        main {
          padding-top: 90px;
        }

        main .container > div:first-of-type h1 {
          font-size: 2rem !important;
        }

        main .container > div:first-of-type p {
          font-size: 1rem !important;
        }

        main .container > div:first-of-type {
          padding: 1.5rem 1rem !important;
        }

        .typing-text {
          font-size: 1.1rem;
          padding: 1.5rem;
        }

        #typingInput {
          font-size: 1rem;
        }

        .stats-grid {
          grid-template-columns: repeat(2, 1fr);
        }

        .controls {
          flex-direction: column;
        }

        .btn {
          min-width: 100%;
        }

        .difficulty-selector {
          flex-direction: column;
          align-items: flex-start;
        }
      }

      @keyframes slideOutDown {
        from {
          opacity: 1;
          transform: translateY(0);
        }
        to {
          opacity: 0;
          transform: translateY(20px);
        }
      }

