/* 🌸⚡🎮 Michaelism ICO - Responsive Styles */

/* ========== Tablet Styles (768px - 1024px) ========== */
@media (max-width: 1024px) {
    /* Typography */
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    /* Main Layout */
    .main-content {
        padding: var(--spacing-md);
    }
    
    /* Tab Navigation */
    .tab-navigation {
        padding: var(--spacing-md);
        gap: var(--spacing-xs);
    }
    
    .tab-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }
    
    .tab-icon {
        font-size: 1rem;
    }
    
    /* Tab Content */
    .tab-content {
        padding: var(--spacing-lg);
    }
}

/* ========== Mobile Styles (max-width: 768px) ========== */
@media (max-width: 768px) {
    /* Typography */
    h1 {
        font-size: 2rem;
        text-align: center;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Tab Navigation */
    .tab-navigation {
        flex-direction: column;
        padding: var(--spacing-sm);
    }
    
    .tab-btn {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-md);
    }
    
    .tab-text {
        display: inline;
    }
    
    /* Tab Content */
    .tab-content {
        padding: var(--spacing-md);
        min-height: 400px;
    }
    
    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Buttons */
    .btn-primary,
    .quantum-btn,
    .btn-secondary {
        width: 100%;
        padding: var(--spacing-md);
        font-size: 0.95rem;
    }
    
    /* Grid Layouts */
    .grid,
    .promotions-grid,
    .rewards-dashboard {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Cards */
    .promo-card,
    .reward-metric,
    .event-card {
        width: 100%;
        min-width: unset;
    }
    
    /* Loading States */
    .loading-container {
        min-height: 300px;
    }
    
    .loader-heart {
        font-size: 2rem;
    }
    
    .loader-text {
        font-size: 1rem;
    }
}

/* ========== Small Mobile Styles (max-width: 480px) ========== */
@media (max-width: 480px) {
    /* Typography */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    p {
        font-size: 0.95rem;
    }
    
    /* Main Layout */
    .main-content {
        padding: var(--spacing-sm);
    }
    
    /* Tab Navigation */
    .tab-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.85rem;
    }
    
    .tab-icon {
        display: none;
    }
    
    /* Tab Content */
    .tab-content {
        padding: var(--spacing-sm);
        border-radius: var(--radius-md);
    }
    
    /* Modal and Overlays */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: var(--spacing-sm);
    }
    
    /* Forms */
    input,
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Tables */
    table {
        font-size: 0.85rem;
    }
    
    .leaderboard-header,
    .leaderboard-row {
        grid-template-columns: 60px 1fr 1fr;
    }
    
    .tier {
        display: none;
    }
}

/* ========== Extra Small Mobile (max-width: 360px) ========== */
@media (max-width: 360px) {
    /* Typography */
    h1 {
        font-size: 1.5rem;
    }
    
    /* Tab Navigation */
    .tab-btn {
        font-size: 0.8rem;
        letter-spacing: 0;
    }
    
    /* Reduce spacing */
    :root {
        --spacing-xs: 0.125rem;
        --spacing-sm: 0.25rem;
        --spacing-md: 0.5rem;
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
    }
}

/* ========== Desktop First Queries ========== */

/* Large Screens (min-width: 1400px) */
@media (min-width: 1400px) {
    .main-content {
        max-width: 1600px;
    }
    
    .tab-navigation {
        justify-content: center;
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== Orientation Specific ========== */

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .tab-navigation {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .tab-btn {
        width: auto;
        flex: 1 1 30%;
    }
    
    .tab-content {
        min-height: 300px;
    }
}

/* ========== High DPI Displays ========== */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Sharper borders for retina displays */
    .tab-btn,
    .tab-content,
    .promo-card {
        border-width: 0.5px;
    }
}

/* ========== Print Styles ========== */
@media print {
    /* Hide interactive elements */
    .tab-navigation,
    .btn-primary,
    .quantum-btn,
    .btn-secondary,
    #wallet-connection-container,
    .social-links {
        display: none !important;
    }
    
    /* Simplify layout */
    .tab-content {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    /* High contrast text */
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    h1, h2, h3 {
        color: black;
        text-shadow: none;
    }
}

/* ========== Accessibility - Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .tab-icon {
        animation: none;
    }
    
    .loader-heart {
        animation: none;
    }
}

/* ========== Touch Device Optimizations ========== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .tab-btn,
    .btn-primary,
    .quantum-btn,
    .btn-secondary {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .tab-btn:hover,
    .btn-primary:hover,
    .quantum-btn:hover {
        transform: none;
    }
    
    /* Add active states for better feedback */
    .tab-btn:active,
    .btn-primary:active {
        transform: scale(0.95);
    }
}