/* =============================================
   BILETINI ALMADAN - Responsive Styles
   Mobile-first approach
   ============================================= */

/* === Small Phones (< 360px) === */
@media (max-width: 359px) {
  .hero-title { font-size: 1.6rem; }
  .hero-subtitle { font-size: 0.9rem; }

  .country-grid {
    grid-template-columns: 1fr;
    padding: 0 var(--space-md);
  }

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

  .filter-tab, .continent-tab {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
  }

  .country-hero-flag { font-size: 2.5rem; }
  .country-hero h1 { font-size: 1.3rem; }

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

/* === Phones (360px - 480px) === */
@media (max-width: 480px) {
  .hero-section {
    padding: var(--space-2xl) var(--space-md) var(--space-lg);
  }

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

  .country-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    padding: 0 var(--space-md);
  }

  .country-card { padding: var(--space-sm) var(--space-md); }
  .country-flag { font-size: 1.8rem; }

  .filters-section { padding: 0 var(--space-md) var(--space-md); }

  .country-detail { padding: var(--space-md); }
  .country-hero { gap: var(--space-md); }
  .country-hero-flag { font-size: 3rem; }
  .country-hero h1 { font-size: 1.5rem; }

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

  .location-card {
    padding: var(--space-sm);
    gap: var(--space-sm);
  }

  .location-info h4 { font-size: 0.85rem; }
  .location-desc { font-size: 0.8rem; }

  .passport-container,
  .profile-container {
    padding: var(--space-md);
  }

  .passport-stats { gap: var(--space-xs); }
  .stat-number { font-size: 1.4rem; }
  .stat-label { font-size: 0.65rem; }

  .stamps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .stamp-flag { font-size: 2rem; }
  .stamp-name { font-size: 0.8rem; }

  .modal-content {
    padding: var(--space-lg);
    margin: var(--space-md);
    max-height: 85vh;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .gmaps-modal-content iframe { height: 280px !important; }

  .full-map {
    height: calc(100vh - 120px);
    height: calc(100dvh - 120px);
  }

  .country-map-container { height: 250px; }

  .plan-day { padding: var(--space-sm); }
  .plan-day-header { flex-direction: column; align-items: flex-start; gap: var(--space-xs); }

  .nav-item { padding: var(--space-sm) var(--space-sm); }
  .nav-icon { font-size: 1.2rem; }
  .nav-label { font-size: 0.6rem; }
}

/* === Tablets (481px - 768px) === */
@media (min-width: 481px) and (max-width: 768px) {
  .country-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 var(--space-lg);
  }

  .stamps-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .passport-container,
  .profile-container {
    max-width: 560px;
  }
}

/* === Desktop (769px+) === */
@media (min-width: 769px) {
  body { padding-bottom: 0; }

  .hero-title { font-size: 2.8rem; }
  .hero-subtitle { font-size: 1.2rem; }

  .search-container { max-width: 600px; }

  .filters-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl) var(--space-md);
  }

  .country-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl) var(--space-xl);
  }

  .country-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl);
  }

  .country-map-container { height: 400px; }

  .passport-container,
  .profile-container {
    max-width: 700px;
  }

  .stamps-grid { grid-template-columns: repeat(4, 1fr); }

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

  /* Desktop nav at top */
  .bottom-nav {
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid var(--border-glass);
    padding: var(--space-sm) var(--space-xl);
    justify-content: center;
    gap: var(--space-md);
  }

  .nav-item {
    flex-direction: row;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
  }

  .nav-item::before {
    top: auto;
    bottom: -1px;
    width: 100%;
  }

  .nav-label { font-size: 0.85rem; }
  .nav-icon { font-size: 1.1rem; }

  .page { padding-top: 60px; }

  .full-map {
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
  }

  .modal-content { max-width: 560px; }
  .gmaps-modal-content { max-width: 700px; }
  .gmaps-modal-content iframe { height: 450px !important; }
}

/* === Large Desktop (1200px+) === */
@media (min-width: 1200px) {
  .country-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1400px;
  }

  .country-detail { max-width: 1000px; }

  .stamps-grid { grid-template-columns: repeat(5, 1fr); }
}

/* === Touch Devices === */
@media (hover: none) and (pointer: coarse) {
  .country-card:hover { transform: none; box-shadow: none; }
  .country-card:hover::before { opacity: 0; }
  .country-card:active { transform: scale(0.98); }

  .stamp-card:hover { transform: none; }
  .stamp-card:active { transform: scale(0.95); }

  .btn-primary:hover { transform: none; }
  .btn-primary:active { transform: scale(0.97); }
}

/* === Landscape Mode (phones) === */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    padding: var(--space-lg) var(--space-lg) var(--space-md);
  }

  .hero-title { font-size: 1.5rem; }
  .hero-subtitle { display: none; }

  .full-map {
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
  }

  .country-map-container { height: 200px; }
}

/* === Dark Mode Preference (already dark, reinforce) === */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .passport-emblem { animation: none; }
  .profile-avatar { animation: none; }
}

/* === Print === */
@media print {
  .bottom-nav,
  .search-container,
  .filter-tabs,
  .continent-tabs { display: none; }

  body {
    background: white;
    color: black;
    padding: 0;
  }

  .page { display: block; }
  .country-card { border: 1px solid #ccc; }
}
