/* ============================================
   ایران کانتر - Responsive Styles
   ============================================ */

/* ---- Extra Large Screens (TVs, 4K) ---- */
@media (min-width: 1920px) {
  :root {
    --container-max: 1600px;
    --header-height: 80px;
  }

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

  .servers-grid {
    gap: 14px;
  }

  .server-info {
    gap: 16px;
  }

  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* ---- Large Desktops ---- */
@media (max-width: 1200px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ---- Tablets & Small Laptops ---- */
@media (max-width: 1024px) {
  :root {
    --header-height: 64px;
  }

  .nav {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .hero-stats {
    gap: 24px;
  }

  .features-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

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

/* ---- Mobile Landscape & Small Tablets ---- */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .section {
    padding: 60px 0;
  }

  .section-title {
    margin-bottom: 40px;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 40px;
  }

  .hero-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
  }
  .hero-stats {
    flex-wrap: wrap;
    gap: 20px;
  }

  .hero-stat {
    flex: 0 0 calc(50% - 10px);
  }

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

  .hero-actions .btn {
    width: 100%;
  }

  .features-grid,
  .shop-grid,
  .blog-grid,
  .downloads-grid {
    grid-template-columns: 1fr;
  }

  .server-card {
    padding: 14px 16px;
    gap: 10px;
  }

  .server-card-bottom {
    flex-wrap: wrap;
    gap: 8px;
  }

  .server-card-bottom .btn {
    width: 100%;
  }

  .server-info {
    min-width: 100%;
    gap: 10px;
  }

  .server-card-left .server-name {
    font-size: 0.92rem;
  }

  .forum-category {
    flex-wrap: wrap;
  }

  .forum-category-stats {
    width: 100%;
    justify-content: flex-start;
    margin-top: 8px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .modal {
    margin: 10px;
    padding: 24px;
  }

  /* Shop buy modal - fix oversized buttons on mobile */
  .modal .btn {
    padding: 10px 14px;
    font-size: 0.85rem;
    gap: 6px;
  }

  .page-content {
    padding-top: calc(var(--header-height) + 24px);
    padding-bottom: 40px;
  }

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

  .pagination {
    flex-wrap: wrap;
  }

  .container {
    padding: 0 16px;
  }
}

/* ---- Mobile Portrait ---- */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-badge {
    font-size: 0.8rem;
    padding: 6px 14px;
  }

  .hero-stat-value {
    font-size: 1.8rem;
  }

  .section-title h2 {
    font-size: 1.25rem;
  }

  .card {
    padding: 20px;
  }

  .server-card {
    padding: 18px;
  }

  .server-info {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.85rem;
  }

  .btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
  }

  .forum-category-icon {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .toast {
    min-width: unset;
    max-width: calc(100vw - 40px);
    font-size: 0.85rem;
  }

  .toast-container {
    left: 10px;
    right: 10px;
  }

  .tabs {
    gap: 0;
  }

  .tab-btn {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
}

/* ---- Print Styles ---- */
@media print {
  .header, .footer, .mobile-nav, .toast-container,
  .music-toggle, .theme-toggle, .ad-banner {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .page-content {
    padding-top: 0;
  }

  .card {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

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

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---- Dark Mode Override for High Contrast ---- */
@media (prefers-contrast: high) {
  :root {
    --border-color: rgba(255, 255, 255, 0.2);
    --border-color-strong: rgba(255, 255, 255, 0.35);
    --text-secondary: #b0bec5;
  }

  [data-theme="light"] {
    --border-color: rgba(0, 0, 0, 0.2);
    --border-color-strong: rgba(0, 0, 0, 0.35);
    --text-secondary: #37474f;
  }
}
