/* ========================================
   RESPONSIVE STYLES - Mobile First
======================================== */

/* Extra Small devices (phones, less than 576px) */
@media (max-width: 575px) {
  .container {
    padding: 0 var(--space-md);
  }

  .hero h1,
  .hero__title {
    font-size: var(--text-2xl);
  }

  .hero p,
  .hero__subtitle {
    font-size: var(--text-sm);
  }

  .hero__features li {
    font-size: var(--text-sm);
  }

  .search-container {
    padding: 0 var(--space-sm);
  }

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

  .widget-card {
    padding: var(--space-lg);
  }

  .widget-score {
    font-size: var(--text-3xl);
  }
}

/* Tablets and below - hide desktop CTA */
@media (max-width: 1024px) {
  .btn-cta.desktop-only {
    display: none !important;
  }
}

/* Tablet hero - image as overlay behind text */
@media (max-width: 1024px) and (min-width: 768px) {
  .hero__container {
    grid-template-columns: 1fr;
    text-align: center;
    position: relative;
  }

  .hero__content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
  }

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

  .hero__features {
    justify-content: center;
  }

  .hero__cta {
    justify-content: center;
  }

  .hero__visual {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 600px;
    z-index: 1;
    pointer-events: none;
  }

  .hero__image {
    opacity: 0.25;
    filter: blur(2px);
    animation: none;
  }
}

/* Small devices (landscape phones, 576px - 767px) */
@media (max-width: 767px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

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

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

  .nav-main {
    display: none;
  }

  .btn-cta.desktop-only {
    display: none;
  }

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

  .hero {
    min-height: auto;
    padding: calc(var(--header-height) + var(--space-2xl)) 0 var(--space-2xl);
  }

  .hero h1,
  .hero__title {
    font-size: var(--text-3xl);
  }

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

  .hero__content {
    max-width: 100%;
  }

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

  .hero__features {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .hero__cta {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .hero__cta .btn,
  .hero__cta .btn--primary,
  .hero__cta .btn--outline {
    width: 100%;
    max-width: 280px;
  }

  /* Hide hero image on mobile */
  .hero__visual {
    display: none !important;
  }

  /* Simplified reveal animations on mobile for better performance */
  .reveal-stagger > * {
    transform: none;
  }

  .reveal-stagger.visible > * {
    transition: opacity 0.4s ease;
    transition-delay: 0s !important;
  }

  .reveal-stagger.visible > .casino-card:hover {
    transform: none;
  }

  .trust-badges {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }

  .tag-chips {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
    -webkit-overflow-scrolling: touch;
  }

  .chip {
    flex-shrink: 0;
  }

  /* Widget */
  .widget-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .widget-info {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .widget-pros-cons {
    text-align: left;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-brand {
    max-width: 100%;
    text-align: center;
  }

  .footer-brand .logo {
    justify-content: center;
  }

  .footer-col {
    text-align: center;
  }

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

  .footer-crystal {
    display: none;
  }

  /* Modal */
  .modal {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header {
    padding: var(--space-md);
  }

  .modal-body {
    padding: var(--space-md);
  }

  /* Page Header */
  .page-header {
    padding: var(--space-2xl) 0 var(--space-xl);
  }

  .page-header h1 {
    font-size: var(--text-2xl);
  }

  /* Article */
  .article-content h1 {
    font-size: var(--text-2xl);
  }

  .article-content h2 {
    font-size: var(--text-xl);
  }

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

  .sidebar {
    position: static;
  }
}

/* Medium devices (tablets, 768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

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

  .nav-main {
    gap: var(--space-lg);
  }

  .nav-main a {
    font-size: var(--text-xs);
  }

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

  .widget-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .widget-info {
    justify-content: center;
  }

  .widget-pros-cons {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
  }

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

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .nav-main {
    display: flex;
  }

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

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

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

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

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

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

  .widget-card {
    grid-template-columns: auto 1fr auto;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero h1,
  .hero__title {
    font-size: var(--text-5xl);
  }

  .hero__container {
    gap: 80px;
  }

  .hero__image {
    max-width: 550px;
  }
}

/* Hover states only on devices that support hover */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-4px);
  }

  .btn-primary:hover {
    transform: translateY(-2px);
  }

  .casino-card:hover {
    transform: translateY(-10px);
  }

  .category-tile:hover {
    transform: translateY(-10px);
  }

  .article-card:hover {
    transform: translateY(-8px);
  }

  /* Tilt effect for casino cards */
  .casino-card {
    transform-style: preserve-3d;
  }
}

/* Touch devices - disable hover transforms */
@media (hover: none) {
  .casino-card:hover,
  .category-tile:hover,
  .article-card:hover,
  .card:hover {
    transform: none;
  }

  .casino-card:active,
  .category-tile:active,
  .article-card:active {
    transform: scale(0.98);
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .circuit-line,
  .circuit-line::after {
    animation: none;
  }

  .btn-cta::before {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }

  .cursor,
  .cursor-dot {
    display: none !important;
  }

  .hero__image {
    animation: none;
  }

  .hero__glow {
    animation: none;
  }
}

/* Dark mode preference (already dark, but ensure consistency) */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --glass-border: rgba(255, 255, 255, 0.3);
    --color-text-secondary: #b0b8c4;
    --color-text-muted: #96a3b8;
  }

  .glass-bg {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Print styles */
@media print {
  .header,
  .footer,
  .mobile-nav,
  .modal,
  .modal-backdrop,
  .cursor,
  .cursor-dot,
  .hero-bg,
  .hero__glow,
  .hero__visual,
  .btn-cta,
  .search-container {
    display: none !important;
  }

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

  body {
    background: white;
    color: black;
  }

  .hero {
    background: none;
    min-height: auto;
    padding: 2rem 0;
  }

  .hero h1,
  .hero__title,
  .hero__title-highlight {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: black;
    color: black;
  }

  a {
    text-decoration: underline;
    color: #0066cc;
  }

  .casino-card,
  .article-card,
  .category-tile,
  .card {
    break-inside: avoid;
    border: 1px solid #ccc;
    background: white;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 991px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: calc(var(--header-height) + var(--space-lg)) 0 var(--space-lg);
  }

  .hero h1,
  .hero__title {
    font-size: var(--text-2xl);
  }

  .hero p,
  .hero__subtitle {
    margin-bottom: var(--space-lg);
  }

  .hero__visual {
    display: none;
  }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
  .header {
    padding-left: max(var(--space-lg), env(safe-area-inset-left));
    padding-right: max(var(--space-lg), env(safe-area-inset-right));
  }

  .footer {
    padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
  }

  .mobile-nav {
    padding-left: max(var(--space-lg), env(safe-area-inset-left));
    padding-right: max(var(--space-lg), env(safe-area-inset-right));
  }
}
