/* ==================== ریسپانسیو ==================== */

@media (max-width: 992px) {
  .app {
    padding: 15px;
  }
  .flashcard {
    height: 420px;
  }
  .flashcard h2 {
    font-size: 32px;
  }
  .stats {
    gap: 15px;
  }
  .stats > div {
    padding: 5px 12px;
  }
  .stats > div span:first-child {
    font-size: 20px;
  }
  .lesson-grid {
    grid-template-columns: 1fr;
  }
  .exercise-input {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* موبایل (عرض کمتر از 768px) */
@media (max-width: 768px) {
  .main-header {
    flex-direction: row;
    justify-content: space-between;
    padding: 15px 20px;
  }
  .logo {
    font-size: 20px;
  }
  .stats {
    gap: 8px;
  }
  .stats > div {
    padding: 4px 10px;
  }
  .stats > div span:first-child {
    font-size: 16px;
  }
  .stats > div small {
    font-size: 9px;
  }

  /* دکمه همبرگر */
  .hamburger-menu {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    margin-left: 0;
    margin-right: 0;
  }
  .hamburger-menu span {
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
  }
  .hamburger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* نویگیشن برای موبایل */
  .main-nav {
    position: fixed;
    top: 70px;
    right: -280px;
    width: 260px;
    height: calc(100vh - 70px);
    background: white;
    flex-direction: column;
    align-items: stretch;
    border-radius: 20px 0 0 20px;
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 1000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15);
    margin: 0;
    gap: 5px;
  }
  .main-nav.open {
    right: 0;
  }
  .main-nav button {
    justify-content: flex-start;
    padding: 12px 16px;
    width: 100%;
    text-align: right;
    font-size: 14px;
    background: var(--light);
    border-radius: 12px;
    margin: 0;
  }
  .main-nav button:hover {
    background: var(--light);
  }
  .main-nav button.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
  }

  .section-title {
    font-size: 22px;
    text-align: center;
  }
  .lesson-card {
    padding: 18px;
  }
  .lesson-card h3 {
    font-size: 18px;
  }
  .flashcard .emoji {
    width: 80px;
    height: 80px;
    font-size: 40px;
  }
  .flashcard h2 {
    font-size: 24px;
  }
  .rating-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
  .exercise-question {
    font-size: 18px;
  }
  .exercise-input {
    width: 100%;
  }
  .dictionary-controls {
    flex-direction: column;
    align-items: center;
  }
  .search-box {
    max-width: 100%;
    width: 100%;
  }
  .dict-filter {
    width: 100%;
  }
  .dict-item {
    flex-direction: column;
    text-align: center;
  }
  .grammar-grid {
    grid-template-columns: 1fr;
  }
  .stories-grid {
    grid-template-columns: 1fr;
  }
  .scenarios-grid {
    grid-template-columns: 1fr;
  }
  .leaderboard-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .podium-container {
    gap: 10px;
  }
  .podium-card {
    min-width: 90px;
    padding: 12px;
  }
  .rank-table th,
  .rank-table td {
    padding: 8px 4px;
    font-size: 11px;
  }
  .quiz-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .quiz-options {
    flex-direction: column;
    align-items: center;
  }
  .quiz-option-btn {
    width: 100%;
    text-align: center;
  }
  .teacher-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .students-table th,
  .students-table td {
    padding: 8px 4px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .main-header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .stats {
    justify-content: center;
  }
  .logo {
    font-size: 18px;
  }
  .flashcard {
    height: 380px;
  }
  .flashcard h2 {
    font-size: 20px;
  }
  .flashcard .emoji {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }
  .section-title {
    font-size: 20px;
  }
  .leaderboard-stats {
    grid-template-columns: 1fr;
  }
  .podium-container {
    flex-direction: column;
    align-items: center;
  }
  .podium-card {
    width: 100%;
  }
  .rank-table th:nth-child(4),
  .rank-table td:nth-child(4) {
    display: none;
  }
  .teacher-stats {
    grid-template-columns: 1fr;
  }
}
