/* Mobile fixes for iPhone and other mobile devices */

/* Fix menu display on small screens */
@media (max-width: 767px) {
  /* Main content */
  main {
    padding-top: 70px !important;
  }

  /* Hide navigation by default */
  nav {
    display: none !important;
  }

  nav.active {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 80% !important;
    height: 100vh !important;
    background: rgba(30, 30, 30, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    z-index: 999 !important;
    padding-top: 80px !important;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2) !important;
    overflow-y: auto !important;
  }

  nav ul {
    display: block !important;
    width: 100% !important;
    padding: 20px !important;
  }

  nav ul li {
    margin: 20px 0 !important;
    text-align: center !important;
    width: 100% !important;
  }

  nav ul li a {
    font-size: 1.2rem !important;
    display: block !important;
    padding: 10px 0 !important;
  }

  /* Fix header and logo */
  header {
    background-color: rgba(18, 18, 18, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    position: fixed !important;
    width: 100% !important;
    padding: 1rem 5% !important;
    z-index: 1000 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .logo h1 {
    font-size: 1.5rem !important;
    margin-bottom: 0 !important;
  }

  /* Fix menu toggle button */
  .menu-toggle {
    display: block !important;
    cursor: pointer !important;
    font-size: 1.8rem !important;
    color: var(--light-color) !important;
    z-index: 2000 !important;
    transition: all 0.3s !important;
    background: none !important;
    border: none !important;
    padding: 5px !important;
  }

  /* Menu overlay */
  .menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  }

  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Fix hero section layout */
  .hero {
    margin-top: 0 !important;
    padding-top: 80px !important;
    min-height: auto !important;
    height: auto !important;
    padding-bottom: 50px !important;
  }
  
  .hero-content {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    padding: 0 15px !important;
  }
  
  .hero-content h1 {
    font-size: 2rem !important;
    text-align: center !important;
    line-height: 1.3 !important;
    width: 100% !important;
  }
  
  .hero-content p {
    text-align: center !important;
    max-width: 100% !important;
    margin: 0 auto 30px !important;
  }
  
  .cta-buttons {
    justify-content: center !important;
  }

  /* Fix learn page hero */
  .learn-hero {
    margin-top: 0 !important;
    padding-top: 80px !important;
    text-align: center !important;
    padding-bottom: 30px !important;
  }

  .learn-hero h1 {
    font-size: 2rem !important;
    text-align: center !important;
    width: 100% !important;
  }
  
  .learn-hero p {
    text-align: center !important;
    max-width: 100% !important;
  }

  /* Fix learn controls */
  .learn-controls {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .search-container {
    width: 100% !important;
    margin-bottom: 10px !important;
  }

  .filter-container {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 10px !important;
  }

  .filter-container select {
    flex: 1 !important;
    max-width: none !important;
  }

  .view-toggle {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    gap: 1rem !important;
  }

  /* Fix button spacing */
  .cta-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  .btn {
    width: 100% !important;
    padding: 1rem !important;
    margin-bottom: 0.5rem !important;
  }

  /* Fix features section on homepage */
  .features {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 1.5rem !important;
    margin: 2rem 1rem !important;
  }

  .feature-card {
    padding: 1.5rem !important;
    margin-bottom: 0 !important;
    max-width: 100% !important;
  }

  .feature-icon {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
  }

  /* Fix sample terms on homepage */
  .sample-terms {
    padding: 2rem 1rem !important;
  }

  .sample-terms h2 {
    font-size: 1.8rem !important;
    margin-bottom: 1.5rem !important;
  }

  .term-preview {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Fix search and filtering tools */
  .search-container {
    width: 100% !important;
  }

  .search-container input,
  .search-container button {
    height: 45px !important;
  }

  /* Fix term cards on mobile */
  .term-card {
    margin-bottom: 1.5rem !important;
    width: 100% !important;
  }

  /* All Terms section title */
  .current-group-info {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .current-group-info h2 {
    font-size: 1.8rem !important;
    text-align: center !important;
  }

  /* Pagination controls */
  .pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    margin-top: 1rem !important;
    margin-bottom: 2rem !important;
  }

  .pagination button {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
  }

  #page-numbers {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.3rem !important;
  }

  /* Fix footer */
  footer {
    padding: 2rem 5% 1rem !important;
  }

  .footer-content {
    grid-template-columns: 1fr !important;
  }

  /* Fix modal for mobile */
  .modal-content {
    width: 95% !important;
    padding: 1.2rem !important;
    margin: 10% auto !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
  }

  .term-details h2 {
    font-size: 1.5rem !important;
    text-align: center !important;
    padding-bottom: 0.8rem !important;
  }

  .usage-scenarios h3, 
  .dialogue-examples h3 {
    font-size: 1.2rem !important;
    margin-bottom: 1rem !important;
  }

  .close-modal {
    top: 10px !important;
    right: 10px !important;
    font-size: 1.5rem !important;
  }

  .term-description {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
  }

  .usage-list li,
  .dialogue-item {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .scenario-context {
    font-size: 0.9rem !important;
  }

  .scenario-example,
  .dialogue-content {
    font-size: 0.85rem !important;
  }
  
  /* Fix overlapping notification */
  .notification-container {
    top: 70px !important;
    max-width: 85% !important;
    right: 10px !important;
  }
}

  /* Adjustments for iPhone height */
  html, body {
    min-height: 100%;
    height: auto !important;
    overflow-x: hidden;
  }

  /* Fix the menu overlay */
  .menu-overlay {
    z-index: 950 !important;
  }

  /* Custom margins for feature sections */
  .stagger-fade-up > * {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Fix vertical spacings */
  section {
    padding: 2rem 1rem !important;
  }

  .notification {
    width: 100% !important;
    padding: 12px !important;
  }
  
  .notification-message {
    font-size: 0.9rem !important;
  }
