/**
 * ZEDEC RESPONSIVE DESIGN SYSTEM
 * Mobile, Tablet, Desktop seamless transitions
 * Trust ID: 441110111613564144
 */

/* ═══════════════════════════════════════════════════════════════════════════
   BASE RESPONSIVE UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Container fluid with max-widths */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Responsive grid system */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Flex utilities */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-sm { gap: 10px; }
.gap-md { gap: 20px; }
.gap-lg { gap: 30px; }

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE FIRST (< 576px)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 575.98px) {
    /* Typography */
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    
    /* Navigation */
    .main-nav {
        flex-direction: column;
        padding: 15px !important;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-link {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
    }
    
    .logo-text { font-size: 1.2rem !important; }
    .tagline { display: none; }
    
    /* Hero sections */
    .hero-section, .pharma-header, .embassy-hero {
        padding: 80px 15px 40px !important;
        min-height: auto !important;
    }
    
    .hero-title { font-size: 2rem !important; line-height: 1.2 !important; }
    .hero-subtitle { font-size: 0.9rem !important; }
    
    /* Stats */
    .stats-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px !important;
    }
    
    /* Cards & Grids */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
    }
    
    .audio-card, .bloc-card, .mission-card {
        padding: 20px !important;
    }
    
    /* Calculator */
    .formula-input {
        flex-direction: column;
    }
    
    .formula-input input,
    .formula-input button {
        width: 100%;
    }
    
    .freq-value {
        font-size: 2rem !important;
    }
    
    /* Solfeggio grid */
    .solfeggio-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Database sidebar */
    .main-container {
        grid-template-columns: 1fr !important;
    }
    
    .database-section {
        max-height: 400px;
    }
    
    /* Chat bar */
    .quacks-chat-bar,
    [id="quacks-chat-bar"],
    div[style*="position:fixed"][style*="bottom:0"] {
        padding: 10px 15px !important;
    }
    
    #quacks-input {
        font-size: 0.85rem !important;
        padding: 10px 15px !important;
    }
    
    /* Ticker tapes */
    #zedec-ticker-container {
        bottom: 55px !important;
    }
    
    .ticker-item {
        padding: 6px 15px !important;
        font-size: 0.7rem !important;
    }
    
    /* Footer */
    .footer, .site-footer {
        padding: 30px 15px 160px !important;
    }
    
    /* Modal */
    .response-modal-content {
        width: 95% !important;
        max-height: 80vh !important;
        padding: 20px !important;
    }
    
    /* Hide on mobile */
    .hide-mobile { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLET (576px - 991px)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 576px) and (max-width: 991.98px) {
    /* Typography */
    h1 { font-size: 2.25rem !important; }
    h2 { font-size: 1.75rem !important; }
    
    /* Navigation */
    .main-nav {
        padding: 15px 20px !important;
    }
    
    .nav-links {
        gap: 10px;
    }
    
    .nav-link {
        padding: 10px 15px !important;
        font-size: 0.85rem !important;
    }
    
    /* Hero */
    .hero-section, .pharma-header {
        padding: 100px 20px 50px !important;
    }
    
    .hero-title { font-size: 2.5rem !important; }
    
    /* Grids */
    .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
    .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
    
    /* Main container */
    .main-container {
        grid-template-columns: 1fr 350px !important;
    }
    
    /* Solfeggio */
    .solfeggio-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
    
    /* Footer */
    .footer, .site-footer {
        padding-bottom: 150px !important;
    }
    
    /* Hide on tablet */
    .hide-tablet { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DESKTOP (992px+)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 992px) {
    /* Navigation */
    .main-nav {
        padding: 15px 30px !important;
    }
    
    /* Hero */
    .hero-title { font-size: 3.5rem !important; }
    
    /* Grids stay as defined */
    
    /* Footer */
    .footer, .site-footer {
        padding-bottom: 140px !important;
    }
    
    /* Show desktop only */
    .show-desktop { display: block !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LARGE DESKTOP (1400px+)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }
    
    .hero-title { font-size: 4rem !important; }
    
    .main-container {
        grid-template-columns: 1fr 450px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOUCH DEVICE OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-link,
    .btn-primary,
    .btn-secondary,
    .filter-btn,
    .solfeggio-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects that might stick */
    .audio-card:hover,
    .bloc-card:hover,
    .drug-item:hover {
        transform: none;
    }
    
    /* Add active states instead */
    .audio-card:active,
    .bloc-card:active,
    .drug-item:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
    .main-nav,
    .quacks-chat-bar,
    #zedec-ticker-container,
    .loading-screen,
    #fractal-loader,
    .play-btn,
    .response-modal {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero-section,
    .pharma-header {
        background: none !important;
        color: black !important;
    }
    
    a { color: #0066cc !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .ticker-track {
        animation: none !important;
    }
    
    .vortex-spinner .ring,
    .fractal-ring {
        animation: none !important;
    }
}

/* High contrast */
@media (prefers-contrast: high) {
    :root {
        --primary: #00ff00;
        --text-secondary: #ffffff;
        --bg-dark: #000000;
    }
    
    .audio-card,
    .bloc-card,
    .drug-item {
        border-width: 2px !important;
    }
}

/* Dark mode is default, but support light preference */
@media (prefers-color-scheme: light) {
    /* Light mode overrides could go here if needed */
}

/* ═══════════════════════════════════════════════════════════════════════════
   ORIENTATION
   ═══════════════════════════════════════════════════════════════════════════ */

@media (orientation: landscape) and (max-height: 500px) {
    /* Compact mode for landscape phones */
    .hero-section, .pharma-header, .embassy-hero {
        min-height: auto !important;
        padding: 60px 20px 30px !important;
    }
    
    .loading-screen {
        padding: 20px;
    }
    
    .vortex-spinner {
        transform: scale(0.7);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SAFE AREAS (notch devices)
   ═══════════════════════════════════════════════════════════════════════════ */

@supports (padding: env(safe-area-inset-bottom)) {
    .quacks-chat-bar,
    div[style*="position:fixed"][style*="bottom:0"] {
        padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    }
    
    #zedec-ticker-container {
        bottom: calc(60px + env(safe-area-inset-bottom)) !important;
    }
}

console.log('📱 Responsive CSS loaded');
