/* ============================================
   MINK'A - Responsive Design System
   Comprehensive mobile & tablet responsive rules
   
   Breakpoints:
   - 1200px : Large screens
   - 1024px : Tablet landscape
   - 768px  : Tablet portrait / mobile landscape
   - 600px  : Small tablets / large phones
   - 480px  : Mobile portrait
   - 360px  : Small mobile
   ============================================ */

/* =============================================
   LARGE SCREENS (max-width: 1200px)
   ============================================= */
@media (max-width: 1200px) {
  .container {
    padding: 0 24px;
  }

  .header__container {
    padding: var(--space-16) 24px;
  }

  .footer__content {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: var(--space-32);
  }
}

/* =============================================
   TABLET LANDSCAPE (max-width: 1024px)
   ============================================= */
@media (max-width: 1024px) {
  /* --- Typography --- */
  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }

  /* --- Landing Hero --- */
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--space-32);
  }

  .hero__title {
    font-size: 2.75rem;
  }

  /* --- Landing Grids --- */
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-24);
  }

  /* --- Home Page --- */
  .home-hero__grid {
    grid-template-columns: 1fr;
  }

  /* --- Search Page --- */
  .search-layout {
    grid-template-columns: 1fr;
  }

  .search-filters {
    position: static;
  }

  /* --- Chat Page --- */
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-sidebar {
    max-height: 300px;
    overflow-y: auto;
  }

  /* --- Detail Page --- */
  .detail-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  /* --- Notifications Page --- */
  .notifications-layout {
    grid-template-columns: 1fr;
  }

  /* --- Profile Page --- */
  .profile__grid {
    grid-template-columns: 1fr;
  }

  /* --- Publish Page --- */
  .publish-layout {
    grid-template-columns: 1fr;
  }

  /* --- Dashboard Page --- */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   TABLET PORTRAIT (max-width: 768px)
   ============================================= */
@media (max-width: 768px) {
  /* --- Typography --- */
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.75rem;
  }
  h3 {
    font-size: 1.25rem;
  }

  /* --- Container --- */
  .container {
    padding: 0 16px;
  }

  /* ===== LANDING HEADER: Hamburger Menu ===== */
  .header__container {
    padding: var(--space-16) 16px;
  }

  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: var(--space-16);
    border-bottom: 2px solid var(--color-gray-50);
    box-shadow: var(--shadow-md);
  }

  .header__nav.header__nav--open {
    display: flex;
    gap: var(--space-16);
  }

  .header__nav-link {
    padding: var(--space-12) var(--space-16);
    border-radius: var(--radius-md);
  }

  .header__nav-link:hover {
    background: var(--color-gray-50);
  }

  .header__menu-toggle {
    display: block;
  }

  .header__cta {
    display: none;
  }

  /* ===== APP HEADER: Slide-out Menu ===== */
  .mobile-menu-toggle {
    display: flex;
  }

  .auth-header__container {
    padding: var(--space-12) 16px;
  }

  .auth-header__nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: var(--color-white);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 80px 20px 24px;
    gap: 4px;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-header__nav.auth-header__nav--open {
    right: 0;
  }

  .auth-header__link {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    justify-content: flex-start;
  }

  .auth-header__link .nav-icon {
    display: inline-block;
  }

  .auth-header__link:hover,
  .auth-header__link[aria-current="page"] {
    background: rgba(46, 204, 113, 0.08);
  }

  .logo-image {
    height: 36px;
  }

  /* ===== LANDING SECTIONS ===== */
  .hero {
    padding: var(--space-48) 0;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--space-32);
  }

  .hero__title {
    font-size: 2.25rem;
    text-align: center;
  }

  .hero__subtitle {
    font-size: 1rem;
    text-align: center;
  }

  .hero__cta-group {
    flex-direction: column;
    align-items: center;
  }

  .hero__image {
    max-width: 400px;
    margin: 0 auto;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-24);
  }

  .benefits-grid {
    grid-template-columns: 1fr;
    gap: var(--space-16);
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-24);
  }

  .stat-card {
    padding: var(--space-24);
  }

  .stat-card__number {
    font-size: 2.25rem;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: var(--space-16);
  }

  .testimonials {
    padding: var(--space-48) 0;
  }

  .impact {
    padding: var(--space-48) 0;
  }

  .cta-final {
    padding: var(--space-48) 0;
  }

  .cta-final__title {
    font-size: 1.75rem;
  }

  .cta-final__subtitle {
    font-size: 1rem;
  }

  /* --- Landing Footer --- */
  .footer__content {
    grid-template-columns: 1fr;
    gap: var(--space-32);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-16);
    text-align: center;
  }

  /* ===== HOME PAGE ===== */
  .home-hero {
    padding: var(--space-32) 0 var(--space-24);
  }

  .home-hero__grid {
    grid-template-columns: 1fr;
  }

  .home-search {
    flex-direction: column;
    max-width: 100%;
  }

  .home-search__form {
    width: 100%;
  }

  .home-search__publish {
    width: 100%;
    justify-content: center;
  }

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

  /* ===== SEARCH PAGE ===== */
  .search-header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-results-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .search-filters-bar {
    flex-wrap: wrap;
  }

  /* ===== CHAT PAGE ===== */
  .chat-container {
    flex-direction: column;
    height: auto;
    min-height: auto;
  }

  .chat-sidebar {
    width: 100%;
    max-height: 250px;
    border-right: none;
    border-bottom: 1px solid var(--color-gray-50);
  }

  .chat-main {
    min-height: 400px;
  }

  /* ===== COMMUNITY PAGE ===== */
  .community-hero {
    padding: 2rem 0;
  }

  .community-hero h1 {
    font-size: 1.75rem;
  }

  .community-hero p {
    font-size: 1rem;
  }

  .challenges-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .challenge-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .challenge-card__body {
    padding: 1rem;
  }

  .challenge-card__footer {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .district-selector {
    flex-direction: column;
    gap: 0.5rem;
  }

  .district-selector select {
    width: 100%;
  }

  /* ===== DASHBOARD PAGE ===== */
  .dashboard-grid,
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-card {
    padding: var(--space-16);
  }

  /* ===== DETAIL PAGE ===== */
  .detail-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-images {
    max-height: 300px;
  }

  .detail-actions {
    flex-direction: column;
  }

  /* --- Timeline (within detail) --- */
  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    left: 12px;
  }

  .timeline-item {
    padding-left: 35px;
  }

  .timeline-marker {
    left: 3px;
    width: 18px;
    height: 18px;
  }

  /* ===== GAMIFICATION PAGE ===== */
  .gamification-grid,
  .badges-grid,
  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .leaderboard-table {
    font-size: 0.85rem;
  }

  /* ===== NOTIFICATIONS PAGE ===== */
  .notifications-container {
    padding: 0;
  }

  .notification-item {
    padding: var(--space-12);
    gap: var(--space-8);
  }

  .notification-item__avatar {
    width: 40px;
    height: 40px;
  }

  .notification-filters {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* ===== PROFILE PAGE ===== */
  .profile__grid {
    grid-template-columns: 1fr;
  }

  .profile-card__header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-card__info {
    align-items: center;
  }

  .profile-card__avatar img {
    width: 80px;
    height: 80px;
  }

  .profile-form__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ===== PUBLISH PAGE ===== */
  .publish-form {
    padding: var(--space-16);
  }

  .publish-layout {
    grid-template-columns: 1fr;
  }

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

  .form__row {
    flex-direction: column;
    align-items: stretch;
  }

  /* ===== SETTINGS PAGE ===== */
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-header h1 {
    font-size: 1.5rem;
  }

  .setting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .settings-card {
    padding: 1.25rem;
  }

  .font-controls {
    flex-wrap: wrap;
  }

  /* ===== AUTH PAGE ===== */
  .auth-container {
    flex-direction: column;
  }

  .auth-card {
    max-width: 100%;
    margin: var(--space-16);
  }

  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-illustration {
    display: none;
  }

  /* ===== MODALS ===== */
  .modal__content {
    padding: var(--space-24);
    max-width: 100%;
    margin: var(--space-16);
    border-radius: var(--radius-lg);
  }
}

/* =============================================
   SMALL TABLETS / LARGE PHONES (max-width: 600px)
   ============================================= */
@media (max-width: 600px) {
  /* Auth page adjustments */
  .auth-form {
    padding: var(--space-24);
  }

  .auth-header__container {
    padding: var(--space-8) 16px;
  }
}

/* =============================================
   MOBILE PORTRAIT (max-width: 480px)
   ============================================= */
@media (max-width: 480px) {
  /* --- Base Typography --- */
  h1 {
    font-size: 1.75rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.1rem;
  }
  p {
    font-size: 0.95rem;
  }

  /* --- Container --- */
  .container {
    padding: 0 12px;
  }

  /* --- App Header compact --- */
  .auth-header__container {
    padding: var(--space-8) 12px;
  }

  .logo-image {
    height: 30px;
  }

  /* --- Buttons --- */
  .btn {
    padding: var(--space-10) var(--space-16);
    font-size: 0.9rem;
  }

  .btn-large {
    padding: var(--space-12) var(--space-24);
    font-size: 1rem;
  }

  /* --- Hero --- */
  .hero {
    padding: var(--space-32) 0;
  }

  .hero__title {
    font-size: 1.75rem;
  }

  .hero__subtitle {
    font-size: 0.95rem;
  }

  /* --- Section spacing --- */
  .section-header {
    margin-bottom: var(--space-32);
  }

  .how-it-works,
  .benefits,
  .testimonials {
    padding: var(--space-32) 0;
  }

  /* --- Step cards --- */
  .step-card {
    padding: var(--space-24);
  }

  .step-card__icon {
    width: 64px;
    height: 64px;
  }

  .step-card__icon img {
    width: 36px;
    height: 36px;
  }

  /* --- Stat cards --- */
  .stat-card {
    padding: var(--space-16);
  }

  .stat-card__number {
    font-size: 2rem;
  }

  .stat-card__label {
    font-size: 1rem;
  }

  /* --- Home Page --- */
  .home-search__form {
    padding: 4px 6px 4px 16px;
  }

  .home-search__input {
    padding: 10px 6px;
    font-size: 0.9rem;
  }

  .home-search__button {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .home-search__publish span {
    display: none;
  }

  .home-search__publish {
    padding: 14px 18px;
  }

  .impact-stats {
    grid-template-columns: 1fr;
  }

  .impact-stat__value {
    font-size: 1.1rem;
  }

  .popular-card img {
    height: 160px;
  }

  /* --- Home Footer --- */
  .home-footer__content {
    flex-direction: column;
    text-align: center;
  }

  .home-footer__brand {
    flex-direction: column;
  }

  .home-footer__links {
    justify-content: center;
    gap: var(--space-12);
  }

  /* --- Community Page --- */
  .community-hero {
    padding: 1.5rem 0;
  }

  .community-hero h1 {
    font-size: 1.5rem;
  }

  .challenge-card__header {
    padding: 1rem;
  }

  .challenge-card__body {
    padding: 1rem;
  }

  .challenge-card__footer {
    padding: 0.75rem 1rem;
  }

  /* --- Search Page --- */
  .search-input {
    font-size: 0.9rem;
  }

  .result-card {
    flex-direction: column;
  }

  .result-card__image {
    width: 100%;
    height: 180px;
  }

  /* --- Chat Page --- */
  .chat-input-area {
    padding: var(--space-8);
  }

  .chat-message {
    max-width: 90%;
  }

  .chat-sidebar {
    max-height: 200px;
  }

  /* --- Dashboard --- */
  .dashboard-header h1 {
    font-size: 1.5rem;
  }

  /* --- Detail Page --- */
  .detail-images {
    max-height: 250px;
  }

  .detail-title {
    font-size: 1.25rem;
  }

  /* --- Gamification --- */
  .gamification-grid,
  .badges-grid,
  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .badge-card,
  .achievement-card {
    padding: var(--space-12);
  }

  /* --- Notifications --- */
  .notification-item {
    padding: var(--space-8);
  }

  .notification-item__text {
    font-size: 0.85rem;
  }

  /* --- Profile --- */
  .profile-card {
    padding: var(--space-16);
  }

  .profile-card__avatar img {
    width: 64px;
    height: 64px;
  }

  .profile-form {
    padding: var(--space-16);
  }

  /* --- Publish --- */
  .image-upload-grid {
    grid-template-columns: 1fr;
  }

  .publish-form {
    padding: var(--space-12);
  }

  /* --- Settings --- */
  .settings-main {
    padding: 1rem 0;
  }

  .settings-card {
    padding: 1rem;
    border-radius: 8px;
  }

  .settings-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  /* --- Auth --- */
  .auth-form {
    padding: var(--space-16);
  }

  .btn-social {
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  /* --- Modals --- */
  .modal__content {
    padding: var(--space-16);
    margin: var(--space-8);
  }

  /* --- Footer --- */
  .footer {
    padding: var(--space-32) 0 var(--space-16);
  }

  .footer__social-link {
    width: 36px;
    height: 36px;
  }

  /* --- CTA Section --- */
  .cta-final__title {
    font-size: 1.5rem;
  }

  .cta-final__button {
    padding: var(--space-12) var(--space-32);
    font-size: 1rem;
  }
}

/* =============================================
   SMALL MOBILE (max-width: 360px)
   ============================================= */
@media (max-width: 360px) {
  .container {
    padding: 0 8px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .btn {
    padding: var(--space-8) var(--space-12);
    font-size: 0.85rem;
  }

  .hero__title {
    font-size: 1.5rem;
  }

  .auth-header__nav {
    width: 240px;
    right: -260px;
  }

  .auth-header__link {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  .stat-card__number {
    font-size: 1.75rem;
  }

  .benefit-card {
    padding: var(--space-16);
  }

  .popular-card img {
    height: 140px;
  }

  .profile-card__avatar img {
    width: 56px;
    height: 56px;
  }
}

/* =============================================
   TOUCH DEVICE ENHANCEMENTS
   ============================================= */
@media (hover: none) and (pointer: coarse) {
  /* Increase tap targets for touch */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .auth-header__link {
    min-height: 44px;
  }

  .header__nav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Remove hover effects that feel wrong on touch */
  .step-card:hover,
  .benefit-card:hover,
  .popular-card:hover,
  .challenge-card:hover {
    transform: none;
  }

  /* Smoother scrolling */
  .chat-messages,
  .chat-sidebar,
  .profile-tabs {
    -webkit-overflow-scrolling: touch;
  }
}

/* =============================================
   LANDSCAPE PHONE SPECIFIC
   ============================================= */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: var(--space-24) 0;
  }

  .hero__image {
    display: none;
  }

  .auth-header__nav {
    padding-top: 60px;
  }

  .community-hero {
    padding: 1rem 0;
  }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
  .header,
  .auth-header,
  .footer,
  .home-footer,
  .mobile-menu-toggle,
  .mobile-nav-overlay,
  .btn,
  .hero__cta-group,
  .cta-final {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .hero__title,
  .hero__subtitle,
  h1,
  h2,
  h3 {
    color: #000;
  }
}
