/**
 * Responsive CSS - Media Queries
 */

/* ==========================================================================
   TABLET (max-width: 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    /* Header */
    .nav-main {
        display: none;
    }

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

    /* Hero */
    .hero-main {
        padding: calc(var(--header-height) + var(--space-2xl)) 0 0;
    }

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

    .hero-decor-left,
    .hero-decor-right,
    .hero-decor-accent,
    .hero-decor-spade,
    .hero-decor-heart,
    .hero-decor-club,
    .hero-decor-dice,
    .hero-decor-chips,
    .hero-decor-cards,
    .hero-decor-extra,
    .hero-decor-roulette,
    .hero-decor-roulette2 {
        display: none;
    }

    .hero-trust {
        gap: var(--space-md);
    }

    .hero-bottom {
        height: 80px;
        margin-top: var(--space-xl);
    }

    .hero-buttons {
        padding: var(--space-md);
    }

    /* Tags Grid */
    .tags-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

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

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

    /* Stats */
    .stats-grid {
        gap: var(--space-lg);
    }
}

/* ==========================================================================
   TABLET PORTRAIT (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    /* Layout */
    :root {
        --header-height: 60px;
    }

    /* Header */
    .header-inner {
        padding: 0 var(--space-md);
    }

    .header-logo img {
        height: 32px;
    }

    .header-logo-text {
        font-size: var(--text-lg);
    }

    /* Hero */
    .hero-main {
        padding: calc(var(--header-height) + var(--space-xl)) 0 0;
    }

    .hero-content {
        padding: var(--space-xl) var(--space-md);
    }

    .hero-subtitle {
        font-size: var(--text-base);
        margin-bottom: var(--space-xl);
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
        padding: var(--space-md);
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
    }

    .hero .btn-primary,
    .hero .btn-secondary {
        padding: var(--space-md) var(--space-lg);
        font-size: var(--text-base);
    }

    .hero-divider {
        width: 120px;
        margin-bottom: var(--space-md);
    }

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

    .hero-trust-item {
        font-size: var(--text-xs);
    }

    .hero-bottom {
        height: 60px;
        margin-top: var(--space-lg);
    }

    /* Tags Grid */
    .tags-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .tag-card {
        padding: var(--space-sm) var(--space-md);
    }

    .tag-card-icon {
        width: 32px;
        height: 32px;
    }

    .tag-card-icon svg {
        width: 16px;
        height: 16px;
    }

    .tags-section {
        padding: var(--space-2xl) 0;
    }

    /* Casino Grid */
    .casino-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

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

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

    .casino-card-rank {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
        top: -6px;
        left: -6px;
    }

    .casino-card-logo {
        height: 40px;
    }

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

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

    .sidebar {
        order: 2;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }

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

    .stat-number {
        font-size: var(--text-3xl);
    }

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

    .article-content h3 {
        font-size: var(--text-lg);
    }

    /* Reset floated images on mobile */
    .article-content figure.image.left,
    .article-content figure.image.right {
        float: none;
        max-width: 100%;
        margin: var(--space-md) 0;
    }

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

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

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

    .modal-body {
        padding: var(--space-md);
        max-height: calc(90vh - 70px);
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: var(--text-xs);
    }
}

/* ==========================================================================
   MOBILE (max-width: 640px)
   ========================================================================== */

@media (max-width: 640px) {
    /* Container */
    :root {
        --container-padding: 1rem;
    }

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

    /* Casino Grid - Single column on very small screens */
    .casino-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Category Cards */
    .category-card {
        padding: var(--space-lg);
    }

    .category-card-icon {
        width: 50px;
        height: 50px;
    }

    .category-card-icon svg {
        width: 24px;
        height: 24px;
    }

    /* Carousel */
    .kw-pill {
        padding: var(--space-xs) var(--space-md);
        font-size: var(--text-xs);
    }

    /* Pagination */
    .pagination-list li a,
    .pagination-list li span {
        min-width: 40px;
        height: 40px;
        padding: 0 var(--space-sm);
        font-size: var(--text-sm);
    }

    .pagination-prev,
    .pagination-next {
        display: none;
    }

    /* Forms */
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Buttons */
    .btn {
        width: 100%;
    }

    .btn-sm {
        width: auto;
    }

    /* Tables (make them scrollable) */
    .article-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ==========================================================================
   VERY SMALL SCREENS (max-width: 380px)
   ========================================================================== */

@media (max-width: 380px) {
    .hero-title {
        font-size: 1.5rem;
    }

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

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

    .header-logo-text {
        display: none;
    }
}

/* ==========================================================================
   TOUCH DEVICE ADJUSTMENTS
   ========================================================================== */

@media (hover: none) {
    /* Disable hover effects on touch devices */
    .card:hover {
        transform: none;
    }

    .card:hover .card-image img {
        transform: none;
    }

    .category-card:hover {
        transform: none;
    }

    .btn-primary:hover,
    .btn-accent:hover {
        transform: none;
    }

    /* Keep focus states for accessibility */
    .card:focus-within {
        transform: translateY(-4px);
        box-shadow: var(--shadow-card-hover);
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

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

    html {
        scroll-behavior: auto;
    }

    .carousel-row {
        animation: none;
    }
}

/* ==========================================================================
   HIGH CONTRAST MODE
   ========================================================================== */

@media (prefers-contrast: high) {
    :root {
        --shadow-card: none;
        --shadow-card-hover: 0 0 0 2px var(--color-text);
    }

    .card,
    .category-card,
    .casino-card {
        border: 2px solid var(--color-text);
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .header,
    .footer,
    .sidebar,
    .carousel-section,
    .mobile-nav,
    .mobile-overlay,
    .modal,
    .modal-overlay,
    .hero-buttons,
    .btn,
    .pagination,
    .casino-grid {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .main-content {
        padding: 0;
    }

    .article-content a {
        text-decoration: underline;
    }

    .article-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    h1, h2, h3, h4 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   LANDSCAPE PHONE
   ========================================================================== */

@media (max-width: 768px) and (orientation: landscape) {
    .hero-main {
        padding: calc(var(--header-height) + var(--space-lg)) 0 0;
    }

    .hero-content {
        padding: var(--space-md);
    }

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

    .hero-subtitle {
        margin-bottom: var(--space-md);
    }

    .hero-bottom {
        height: 40px;
        margin-top: var(--space-md);
    }

    .modal {
        max-height: 95vh;
    }
}

/* ==========================================================================
   LARGE SCREENS (min-width: 1400px)
   ========================================================================== */

@media (min-width: 1400px) {
    .container-wide {
        max-width: 1600px;
    }

    .casino-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--space-lg);
    }
}
