/* ==========================================================================
   Responsive - Mobile-first breakpoints
   ========================================================================== */

/*
   Breakpoints:
   - Mobile: 0 - 639px (default)
   - Tablet: 640px - 767px (sm)
   - Tablet Landscape: 768px - 1023px (md)
   - Desktop: 1024px - 1279px (lg)
   - Large Desktop: 1280px+ (xl)
*/

/* ==========================================================================
   Small Screens (640px+) - Tablets Portrait
   ========================================================================== */

@media (min-width: 640px) {
  /* Grid */
  .sm\:grid-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:grid-3 { grid-template-columns: repeat(3, 1fr); }

  /* Flexbox */
  .sm\:flex-row { flex-direction: row; }
  .sm\:flex-col { flex-direction: column; }

  /* Display */
  .sm\:hidden { display: none; }
  .sm\:block { display: block; }
  .sm\:flex { display: flex; }

  /* Container */
  .container {
    padding: 0 var(--space-lg);
  }

  /* Pros/Cons Grid */
  .pros-cons {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer Grid */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer Bottom */
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  /* Hero */
  .hero-actions {
    flex-direction: row;
  }

  /* Casino Card Horizontal */
  .casino-card--horizontal {
    flex-direction: row;
  }

  .casino-card--horizontal .casino-card-image {
    width: 200px;
    flex-shrink: 0;
  }
}

/* ==========================================================================
   Medium Screens (768px+) - Tablets Landscape
   ========================================================================== */

@media (min-width: 768px) {
  /* Grid */
  .md\:grid-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-4 { grid-template-columns: repeat(4, 1fr); }

  /* Layout with Sidebar */
  .layout-with-sidebar {
    grid-template-columns: 1fr 300px;
  }

  .layout-with-sidebar--reverse {
    grid-template-columns: 300px 1fr;
  }

  /* Display */
  .md\:hidden { display: none; }
  .md\:block { display: block; }
  .md\:flex { display: flex; }

  /* Header Height */
  .main-content {
    padding-top: var(--header-height);
  }

  /* Footer Grid */
  .footer-grid {
    grid-template-columns: 2fr repeat(3, 1fr);
  }

  /* Category Cards Grid */
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Article Cards Grid */
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Large Screens (1024px+) - Desktops
   ========================================================================== */

@media (min-width: 1024px) {
  /* Grid */
  .lg\:grid-2 { grid-template-columns: repeat(2, 1fr); }
  .lg\:grid-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:grid-5 { grid-template-columns: repeat(5, 1fr); }

  /* Display */
  .lg\:hidden { display: none; }
  .lg\:block { display: block; }
  .lg\:flex { display: flex; }

  /* Navigation */
  .nav {
    display: flex;
  }

  .mobile-menu-btn {
    display: none;
  }

  .mobile-menu {
    display: none;
  }

  /* Layout with Sidebar */
  .layout-with-sidebar {
    grid-template-columns: 1fr 320px;
    gap: var(--space-2xl);
  }

  /* Category Cards Grid */
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Article Cards Grid */
  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Casino Cards Grid */
  .casinos-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .hero-title {
    font-size: var(--text-4xl);
  }

  /* Section spacing */
  .section {
    padding: var(--space-4xl) 0;
  }
}

/* ==========================================================================
   Extra Large Screens (1280px+) - Large Desktops
   ========================================================================== */

@media (min-width: 1280px) {
  /* Grid */
  .xl\:grid-3 { grid-template-columns: repeat(3, 1fr); }
  .xl\:grid-4 { grid-template-columns: repeat(4, 1fr); }
  .xl\:grid-5 { grid-template-columns: repeat(5, 1fr); }
  .xl\:grid-6 { grid-template-columns: repeat(6, 1fr); }

  /* Display */
  .xl\:hidden { display: none; }
  .xl\:block { display: block; }
  .xl\:flex { display: flex; }

  /* Container */
  .container {
    padding: 0 var(--space-xl);
  }

  /* Category Cards Grid */
  .categories-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  /* Casino Cards Grid */
  .casinos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Mobile-specific Overrides (max-width queries)
   ========================================================================== */

@media (max-width: 639px) {
  /* Mobile header */
  .header {
    height: var(--header-height-mobile);
  }

  .main-content {
    padding-top: var(--header-height-mobile);
  }

  /* Logo */
  .logo {
    font-size: var(--text-lg);
  }

  .logo-icon {
    width: 32px;
    height: 32px;
  }

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

  .hero-title {
    font-size: var(--text-2xl);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

  /* Cards */
  .card-body {
    padding: var(--space-md);
  }

  /* Buttons */
  .btn-cta {
    width: 100%;
    padding: 0.875rem 1.5rem;
  }

  /* Section */
  .section {
    padding: var(--space-xl) 0;
  }

  /* Tables - horizontal scroll */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Casino card actions */
  .casino-card-actions {
    flex-direction: column;
  }

  .casino-card-actions .btn {
    width: 100%;
  }

  /* Breadcrumbs */
  .breadcrumbs {
    font-size: var(--text-xs);
  }

  /* TOC */
  .toc {
    padding: var(--space-md);
  }

  /* Top Casinos */
  .top-casinos {
    padding: var(--space-md);
  }

  /* Pagination */
  .pagination {
    flex-wrap: wrap;
  }

  .pagination-btn {
    min-width: 40px;
    min-height: 40px;
    padding: var(--space-xs);
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  /* Hide non-essential elements */
  .header,
  .footer,
  .mobile-menu,
  .mobile-menu-btn,
  .sidebar,
  .btn,
  .pagination,
  .carousel-section,
  .top-casinos {
    display: none !important;
  }

  /* Reset colors for print */
  body {
    background: white;
    color: black;
  }

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

  /* Show full URLs for links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  /* Page breaks */
  h1, h2, h3 {
    page-break-after: avoid;
  }

  .card, .article-card {
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   Dark Mode Support (if needed in future)
   ========================================================================== */

@media (prefers-color-scheme: light) {
  /* Site is already dark, so light mode would need explicit opt-in */
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
  :root {
    --color-primary: #ffd700;
    --color-text: #ffffff;
    --color-text-muted: #e0e0e0;
  }

  .btn,
  .card,
  .form-input {
    border-width: 2px;
  }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .carousel-row--1,
  .carousel-row--2,
  .carousel-row--3 {
    animation: none;
  }

  .card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }
}
