/* ==========================================================================
   NXPHNK MASTER DESIGN SYSTEM CORES & VARIABLES
   ========================================================================== */
:root {
    --bg-black: #050506;
    --card-bg: rgba(13, 13, 16, 0.65);
    --glass-border: rgba(255, 255, 255, 0.04);
    --glass-highlight: rgba(255, 255, 255, 0.08);
    --accent-neon: #ffffff;
    --accent-dim: #88888e;
    --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-micro: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-black);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Base Ambient Lighting System */
.ambient-glow {
    position: fixed;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
}
#glow1 { top: -10%; left: -10%; }
#glow2 { bottom: -10%; right: -10%; }

/* Persistent Header Component layout */
.main-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(5, 5, 6, 0.7);
    backdrop-filter: blur(20px);
}

.logo-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: 3px;
    font-size: 1rem;
}

.main-loop {
    animation: spin 4s linear infinite;
    color: var(--accent-dim);
}

.genre-nav {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
}

.genre-btn {
    background: transparent;
    border: none;
    color: var(--accent-dim);
    padding: 6px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-micro);
}

.genre-btn:hover, .genre-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.system-status {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 6px; height: 6px;
    background: #ffffff;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Home Portal Mode Chooser UI */
.mode-selector-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 70px 20px 20px 20px;
    z-index: 10;
    position: relative;
}

.glitch-text {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 8px;
    text-align: center;
    margin-bottom: 8px;
}

.sub-tagline {
    font-size: 0.75rem;
    letter-spacing: 4px;
    color: var(--accent-dim);
    margin-bottom: 40px;
}

.mode-cards {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 800px;
}

.mode-card {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(30px);
    transition: var(--transition-smooth);
}

.mode-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--accent-dim);
    margin-bottom: 20px;
    transition: var(--transition-micro);
}

.mode-card:hover .card-icon { color: #ffffff; }

.mode-card h2 { font-size: 1.2rem; letter-spacing: 2px; margin-bottom: 10px; }
.mode-card p { font-size: 0.75rem; color: var(--accent-dim); line-height: 1.5; }

.scanline {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.3;
}

/* Master Framework Media Grid Engine Dashboard Layout */
.media-hub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 30px 30px 30px;
    min-height: 100vh;
}

.playlist-section { display: flex; flex-direction: column; }
.section-title-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-title-bar h3 { font-size: 0.8rem; letter-spacing: 2px; color: var(--accent-dim); }

.back-to-mode-btn {
    background: none; border: 1px solid var(--glass-border);
    color: var(--accent-dim); padding: 6px 12px; border-radius: 6px;
    cursor: pointer; font-size: 0.7rem; font-weight: 600;
    transition: var(--transition-micro);
}
.back-to-mode-btn:hover { color: #ffffff; border-color: rgba(255,255,255,0.2); }

.tracks-grid {
    display: flex; flex-direction: column; gap: 10px;
    max-height: calc(100vh - 180px); overflow-y: auto; padding-right: 5px;
}
.tracks-grid::-webkit-scrollbar { width: 4px; }
.tracks-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); border-radius: 2px; }

/* Interactive Track Row Objects UI */
.track-row-item {
    display: flex; align-items: center;
    background: rgba(13, 13, 16, 0.3);
    border: 1px solid var(--glass-border);
    padding: 12px 16px; border-radius: 12px;
    cursor: pointer; transition: var(--transition-smooth);
}
.track-row-item:hover, .track-row-item.active {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.row-img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; margin-right: 15px; }
.row-meta { flex: 1; min-width: 0; }
.row-meta h4 { font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.row-meta p { font-size: 0.7rem; color: var(--accent-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-genre-badge { font-size: 0.55rem; font-weight: 800; color: var(--accent-dim); border: 1px solid var(--glass-border); padding: 3px 6px; border-radius: 4px; }

/* Right Console Deck Presentation Space */
.console-section { position: sticky; top: 100px; height: calc(100vh - 140px); }
.glass-deck {
    width: 100%; height: 100%; background: var(--card-bg);
    border: 1px solid var(--glass-border); border-radius: 20px;
    padding: 30px; display: flex; flex-direction: column;
    justify-content: space-between; position: relative; overflow: hidden;
    backdrop-filter: blur(40px);
}

.blur-bg-engine {
    position: absolute; top: -10%; left: -10%; width: 120%; height: 120%;
    background-size: cover; background-position: center;
    filter: blur(50px) brightness(0.2); z-index: -1; opacity: 0.9;
    transition: background-image 0.5s ease;
}

/* Audio Mode Dynamic Display components */
.art-wrapper { display: flex; justify-content: center; align-items: center; margin: auto 0; }
.art-frame { position: relative; width: 180px; height: 180px; }
#deckArt { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; position: relative; z-index: 2; border: 1px solid rgba(255,255,255,0.08); }
.vinyl-disk {
    position: absolute; top: 5px; right: -20px; width: 170px; height: 170px;
    background: radial-gradient(circle, #000 20%, #111 40%, #000 60%, #222 80%, #050505 100%);
    border-radius: 50%; z-index: 1; transition: right 0.5s ease;
    animation: spin 3s linear infinite; animation-play-state: paused;
}
.playing .vinyl-disk { right: -50px; animation-play-state: running; }

/* Video Tube Cinema Layer Panel */
.video-portal-container { width: 100%; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.06); }
.video-ratio-lock { width: 100%; position: relative; padding-top: 56.25%; }
#mainVideoPlayer { position: absolute; top:0; left:0; width:100%; height:100%; object-fit: cover; }
.video-overlay-ui { position: absolute; top: 10px; right: 10px; }
.resolution-badge { background: rgba(0, 0, 0, 0.8); border: 1px solid rgba(255,255,255,0.15); padding: 3px 8px; font-size: 0.6rem; font-weight: 800; border-radius: 4px; }

/* Labels Metrics Elements */
.meta-display { text-align: center; margin-bottom: 10px; }
.meta-display h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: 0.5px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-row { font-size: 0.7rem; color: var(--accent-dim); }
.artist-row .val { color: #ffffff; font-weight: 600; }
.artist-row .separator { margin: 0 6px; opacity: 0.2; }

/* Visualizer Graphic Element */
.visualizer-strip { display: flex; justify-content: center; align-items: flex-end; gap: 3px; height: 16px; margin-bottom: 15px; }
.visualizer-strip .bar { width: 2px; height: 3px; background: rgba(255, 255, 255, 0.1); border-radius: 1px; }
.playing .visualizer-strip .bar { background: #ffffff; animation: bounceVis 0.5s ease infinite alternate; }
.playing .visualizer-strip .bar:nth-child(2n) { animation-delay: 0.15s; animation-duration: 0.3s; }
.playing .visualizer-strip .bar:nth-child(3n) { animation-delay: 0.05s; animation-duration: 0.6s; }

/* Media Seek Timelines Track Node */
.timeline-container { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.time-stamp { font-size: 0.65rem; font-weight: 600; font-family: monospace; color: var(--accent-dim); }
.progress-bar-wrapper { flex: 1; height: 4px; background: rgba(255, 255, 255, 0.06); border-radius: 2px; position: relative; cursor: pointer; }
.progress-bar-fill { height: 100%; width: 0%; background: #ffffff; border-radius: 2px; position: relative; }
.progress-handle { width: 8px; height: 8px; background: #ffffff; border-radius: 50%; position: absolute; top: 50%; right: -4px; transform: translateY(-50%) scale(0); transition: transform 0.1s; }
.progress-bar-wrapper:hover .progress-handle { transform: translateY(-50%) scale(1); }

/* Control Hub Matrix */
.control-matrix { display: flex; justify-content: center; align-items: center; gap: 16px; margin-bottom: 20px; }
.ctrl-btn { background: none; border: none; color: var(--accent-dim); font-size: 1rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.ctrl-btn:hover { color: #ffffff; }
.ctrl-btn .sec-lbl { font-size: 0.5rem; font-weight: 700; margin-top: 1px; }
.master-play-btn { width: 44px; height: 44px; background: #ffffff; color: #000; border-radius: 50%; font-size: 1rem; justify-content: center; transition: var(--transition-smooth); }
.master-play-btn:hover { transform: scale(1.05); }

/* Master Mix Deck Rack Board Panel */
.mixing-board { background: rgba(0, 0, 0, 0.2); border: 1px solid var(--glass-border); border-radius: 12px; padding: 12px; display: flex; justify-content: space-between; align-items: center; }
.mix-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.mix-title { font-size: 0.5rem; font-weight: 800; color: var(--accent-dim); letter-spacing: 0.5px; }
.volume-box { display: flex; align-items: center; gap: 6px; }
.vertical-slider { -webkit-appearance: none; appearance: none; width: 45px; height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; outline: none; }
.vertical-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 8px; border-radius: 50%; background: #ffffff; cursor: pointer; }

.eq-toggle-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.eq-toggle-btn { background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border); color: var(--accent-dim); padding: 4px 8px; font-size: 0.55rem; font-weight: 700; border-radius: 4px; cursor: pointer; }
.eq-toggle-btn.active { color: #000; background: #ffffff; border-color: #ffffff; }
.led-indicator { width: 3px; height: 3px; background: rgba(255,255,255,0.05); border-radius: 50%; }
.eq-toggle-btn.active + .led-indicator { background: #ffffff; box-shadow: 0 0 6px #fff; }

.quality-selector-rack { display: flex; gap: 2px; background: rgba(0,0,0,0.3); padding: 2px; border-radius: 4px; }
.q-btn { background: none; border: none; color: var(--accent-dim); font-size: 0.55rem; font-weight: 800; padding: 4px 6px; border-radius: 2px; cursor: pointer; }
.q-btn.active { background: rgba(255,255,255,0.08); color: #ffffff; }

.hidden { display: none !important; }
.micro-bounce:active { transform: scale(0.9); }

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes bounceVis { 0% { height: 3px; } 100% { height: 16px; } }

/* ==========================================================================
   DEVICE SPECIFIC HARDWARE RESPONSIVE MEDIA BREAKPOINTS
   ========================================================================== */

/* --------------------------------------------------------------------------
   A. LAPTOPS & DESKTOPS (Windows / macOS Screen Environments)
   -------------------------------------------------------------------------- */
@media screen and (min-width: 1025px) {
    /* Baseline layout definitions inherit two-column split structure config grids seamlessly */
    .media-hub {
        grid-template-columns: 1fr 1fr;
    }
}

/* --------------------------------------------------------------------------
   B. TABLETS & LARGE HANDHELDS (iPad, Galaxy Tab, Landscape Mobile Foldables)
   -------------------------------------------------------------------------- */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .media-hub {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 20px;
        padding: 90px 20px 20px 20px;
    }
    .art-frame { width: 150px; height: 150px; }
    .vinyl-disk { width: 140px; height: 140px; }
    .playing .vinyl-disk { right: -40px; }
    .mode-cards { max-width: 90%; gap: 20px; }
}

/* --------------------------------------------------------------------------
   C. SMARTPHONES & SMALL MOBILE DEVICES (iOS Safari / Android Chrome Layouts)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    /* Convert layouts to single row stacked architecture engines instantly */
    .main-header {
        padding: 0 16px;
        height: 60px;
    }
    
    .genre-nav {
        max-width: 60%;
        overflow-x: auto;
        white-space: nowrap;
    }
    .genre-btn {
        padding: 4px 10px;
        font-size: 0.65rem;
    }
    .system-status { display: none; } /* Drop redundant overhead elements to save valuable real estate */

    .glitch-text { font-size: 2rem; letter-spacing: 4px; }
    .sub-tagline { font-size: 0.65rem; letter-spacing: 2px; margin-bottom: 30px; }
    
    .mode-cards {
        flex-direction: column;
        gap: 16px;
        width: 100%;
        padding: 0 10px;
    }
    
    .mode-card {
        padding: 30px 20px;
    }
    
    /* Layout inversion configuration block */
    .media-hub {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 80px 16px 16px 16px;
    }

    /* Flip order to mimic true video streams platforms app layout mechanics */
    .console-section {
        position: relative;
        top: 0;
        height: auto;
        order: 1; /* Elevate track dashboard presentation blocks to viewport tops instantly */
    }
    
    .playlist-section {
        order: 2; /* Move track archive scrolling listings below active theater viewport blocks */
    }

    .glass-deck {
        padding: 16px;
        height: auto;
        gap: 16px;
    }

    .art-frame { width: 130px; height: 130px; }
    .vinyl-disk { width: 120px; height: 120px; }
    .playing .vinyl-disk { right: -30px; }

    .tracks-grid {
        max-height: 350px; /* Lock infinite growth leaks to avoid app structure drops */
    }

    .mixing-board {
        flex-wrap: wrap;
        gap: 12px;
    }
    .mix-col {
        flex: unset;
        width: calc(50% - 6px); /* Dynamic inline split card matrices wrappers layout grids */
    }
    .mix-col.video-exclusive-ui {
        width: 100%;
    }
}