﻿/* ==========================================================================
   GRAMMAR MASTER - RESPONSIVE DESIGN & ACCESSIBILITY (WCAG)
   Breakpoints: 1440px, 1024px, 768px, 480px, 360px
   ========================================================================== */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .app-main-content {
    max-width: 1300px;
    padding: 2.5rem;
  }
  .examples-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablets & Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 280px;
  }
  .app-main-content {
    padding: 1.5rem;
  }
  .dashboard-hero-card {
    flex-direction: column;
    text-align: center;
    padding: 2rem;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-stats-panel {
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
  }
  .examples-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablets & Mobile (<= 768px) - Drawer Menu Transformation */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .header-search-bar {
    display: none; /* Accessible via modal */
  }

  .header-stat-chip {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 85%;
    max-width: 320px;
    background: var(--bg-surface);
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }

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

  /* Overlay */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 90;
    display: none;
  }

  .sidebar-overlay.overlay-active {
    display: block;
  }

  .app-main-content {
    padding: 1rem;
  }

  .lesson-main-title {
    font-size: 1.65rem;
  }

  .didactic-block {
    padding: 1.25rem;
  }

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

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

  .drill-item-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .lesson-nav-buttons {
    flex-direction: column;
  }

  .btn-nav-prev, .btn-nav-next, .btn-nav-gym, .btn-nav-speed {
    width: 100%;
    text-align: center;
  }
}

/* Small Mobile Screens (360px - 430px) */
@media (max-width: 430px) {
  :root {
    --header-height: 64px;
  }

  .brand-logo-img {
    height: 38px;
  }

  .brand-main-name {
    font-size: 1.1rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .btn-primary-action, .btn-secondary-action {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .flashcard-card {
    min-height: 220px;
    padding: 1.25rem;
  }

  .card-main-text {
    font-size: 1.35rem;
  }

  .fc-buttons-row {
    flex-direction: column;
    width: 100%;
  }

  .btn-fc-rate {
    width: 100%;
  }
}

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