/**
 * Responsive CSS - Toto21 Dark Emerald Theme
 */

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

@media (max-width: 1024px) {
    .nav-main { display: none; }
    .mobile-menu-toggle { display: flex; }

    .header-nav-inner {
        justify-content: space-between;
    }

    .header-topbar-badges {
        gap: var(--space-sm);
    }

    .topbar-badge:nth-child(3) { display: none; }

    /* Timeline */
    .timeline-layout {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    /* Steps */
    .steps-grid {
        flex-wrap: wrap;
    }

    .step-connector { display: none; }

    .step-card {
        min-width: 200px;
        flex: 1 1 calc(33% - var(--space-lg));
    }

    /* Stats */
    .stats-row-grid {
        flex-wrap: wrap;
    }

    .stats-row-item { flex: 1 1 calc(50% - 2px); }
    .stats-row-divider:nth-child(4) { display: none; }

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

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

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

@media (max-width: 768px) {
    :root {
        --header-topbar-height: 0px;
        --header-nav-height: 60px;
        --header-height: 60px;
        --total-header-height: 60px;
    }

    .header-topbar { display: none; }

    /* Hero */
    .hero-rain-title { font-size: 2rem; }
    .hero-rain-subtitle { font-size: var(--text-base); }

    .hero-rain-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .hero-rain-trust { gap: var(--space-sm); }
    .trust-pill { font-size: 0.75rem; }

    /* Stats */
    .stats-row-grid { flex-wrap: wrap; }
    .stats-row-item { flex: 1 1 calc(50% - 2px); }
    .stats-row-divider { display: none; }

    /* Mag grid */
    .mag-grid { grid-template-columns: repeat(2, 1fr); }
    .mag-card { height: 220px; }

    /* Steps */
    .steps-grid { flex-direction: column; gap: var(--space-lg); }
    .step-connector { display: none; }

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

    /* Article */
    .layout-sidebar { grid-template-columns: 1fr; }
    .sidebar { order: 2; }

    .article-content h2 { font-size: var(--text-xl); }
    .article-content h3 { font-size: var(--text-lg); }
    .article-content figure.image.left,
    .article-content figure.image.right {
        float: none;
        max-width: 100%;
        margin: var(--space-md) 0;
    }

    /* Related */
    .related-articles-grid { grid-template-columns: 1fr; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-links { align-items: center; }
    .footer-brand p { max-width: 100%; }

    /* Section */
    .section-header { margin-bottom: var(--space-xl); }
    .section-title { font-size: var(--text-2xl); }

    /* Breadcrumb */
    .breadcrumb {
        padding-top: calc(var(--total-header-height) + var(--space-md));
        font-size: var(--text-xs);
    }

    /* Tags cloud */
    .tags-cloud { gap: var(--space-xs); }

    /* Timeline */
    .timeline-balls { gap: 8px; }
    .timeline-ball { width: 36px; height: 36px; font-size: 0.8rem; }

    /* Modal */
    .modal { width: 95%; max-height: 90vh; }
    .modal-header { padding: var(--space-md); }
    .modal-body { padding: var(--space-md); max-height: calc(90vh - 70px); }
}

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

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

    /* Hero */
    .hero-rain-title { font-size: 1.75rem; }
    .hero-rain-badge { font-size: 0.7rem; }
    .hero-rain-trust { flex-direction: column; align-items: flex-start; gap: 6px; }

    /* Mag grid */
    .mag-grid { grid-template-columns: 1fr; }

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

    /* Steps */
    .step-card { padding: var(--space-xl) var(--space-lg); }
    .step-icon { width: 50px; height: 50px; }
    .step-num { font-size: 2.5rem; }

    /* Buttons */
    .btn { width: 100%; }
    .btn-sm { width: auto; }
    .btn-gold, .btn-outline-light { width: 100%; justify-content: center; }

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

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

    /* Stats */
    .stats-row-item { flex: 1 1 100%; }
    .stats-row-divider { display: none; }

    /* 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; }
}

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

@media (max-width: 380px) {
    .hero-rain-title { font-size: 1.5rem; }
    .casino-grid-new { grid-template-columns: 1fr; }
    .header-logo-text { display: none; }
}

/* ==========================================================================
   TOUCH DEVICES
   ========================================================================== */

@media (hover: none) {
    .mag-card:hover { transform: none; }
    .mag-card:hover .mag-card-img { transform: none; }
    .category-card:hover { transform: none; }
    .btn-gold:hover { transform: none; }
    .step-card:hover { transform: 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;
    }
    html { scroll-behavior: auto; }
    .carousel-row { animation: none; }
    .coin { animation: none !important; }
    .reveal { opacity: 1 !important; transform: none !important; }
}

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

@media print {
    .header, .footer, .sidebar,
    .mobile-nav, .mobile-overlay,
    .modal, .modal-overlay,
    .hero-rain-actions, .btn, .btn-gold,
    .casino-grid-new, .cta-banner, .coin-rain { display: none !important; }
    body { background: white; color: black; font-size: 12pt; }
    .main-content { padding: 0; }
    .article-content a { text-decoration: underline; }
    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-rain { min-height: auto; padding-top: var(--total-header-height); }
    .hero-rain-content { padding: var(--space-xl) 0; }
    .hero-rain-title { font-size: var(--text-2xl); margin-bottom: var(--space-sm); }
    .hero-rain-subtitle { margin-bottom: var(--space-md); }
}

/* ==========================================================================
   LARGE SCREENS
   ========================================================================== */

@media (min-width: 1400px) {
    .casino-grid-new { grid-template-columns: repeat(5, 1fr); }
}
