:root {
    /* Editorial webOS / OS-level Tokens */
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    
    /* Asymmetric Editorial Gradients (Slightly Darker Base) */
    --bg-base: #09176B; /* Deep ambient blue */
    --bg-mid: #1D4ED8;
    --bg-bloom: #22D3EE;
    
    /* Integrated Ethereal Glass (Slightly increased opacity to feel 'more glassy but not a lot') */
    --glass-base: rgba(255, 255, 255, 0.07); 
    --glass-border: rgba(255, 255, 255, 0.12);
    
    /* Soft Elevation */
    --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.15);
    
    /* High Clarity Text */
    --text-heading: #FFFFFF;
    --text-body: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(255, 255, 255, 0.75);
    
    /* Subdued Flat Progress Accent */
    --accent-progress: #4ADE80; /* Soft Green */
    --accent-teal: #38BDF8; /* Soft Cyan */
    
    --curve-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-stack);
    font-size: 15px;
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
    background-color: var(--bg-base);
}

/* Premium Asymmetric Gradient Base NO NOISE NO GRAIN */
#desktop-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 90% 100%, rgba(34, 211, 238, 0.25) 0%, transparent 60%), /* SubtleCyan Bloom BTM Right */
        radial-gradient(circle at 20% 0%, rgba(29, 78, 216, 0.8) 0%, transparent 70%); /* Deep Blue Mid Top Left */
}

#desktop {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

#desktop.learn-mode-active ~ #desktop-bg {
    filter: brightness(0.85) blur(4px);
    transition: filter 0.8s var(--curve-smooth);
}

/* Era Label */
.era-label {
    position: absolute;
    top: 48px;
    left: 48px;
    color: var(--text-heading);
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 0.8px;
}

/* Mode Toggle */
.mode-toggle {
    position: absolute;
    top: 48px;
    right: 48px;
    display: flex;
    z-index: 100;
    background: var(--glass-base);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px) saturate(110%);
    -webkit-backdrop-filter: blur(14px) saturate(110%);
    border-radius: 40px;
    padding: 6px;
    box-shadow: var(--shadow-soft);
}

.toggle-btn {
    background: transparent;
    border: none;
    padding: 8px 24px;
    font-family: var(--font-stack);
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.2s ease;
    outline: none;
}

.toggle-btn:hover {
    color: var(--text-heading);
}

.toggle-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-heading);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
}

/* Layout Wrapper */
#layout-wrapper {
    position: absolute;
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 1300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Airy Minimal Glass Panel */
.window {
    background-color: var(--glass-base);
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    box-shadow: var(--shadow-soft), inset 0 1px 1px rgba(255,255,255,0.08); /* Boosted glass physics slightly */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Title Bar - Minimal */
.title-bar {
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px 0 32px;
    user-select: none;
    position: relative;
    z-index: 2;
}

.title-icon { display: none; }
.title-left { display: flex; align-items: center; }

.title-text {
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
}

.window-btn { display: none; }

/* --- MUSIC PLAYER --- */

#player-window-glow-proxy { display: none; } 

#player-window {
    width: 540px;
    padding-bottom: 32px;
    transition: transform 0.8s var(--curve-smooth), opacity 0.8s var(--curve-smooth);
    transform-origin: center;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

.window-content {
    padding: 24px 32px 32px 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

/* Display Panel */
.display-panel {
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.display-main {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
}

.time-display {
    font-size: 4rem;
    line-height: 1;
    font-weight: 300;
    color: var(--text-heading);
    font-variant-numeric: tabular-nums;
    margin-bottom: 12px;
}

.track-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.song-title {
    font-size: 1.45rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metadata {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Clean Flat EQ Bars */
.equalizer {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 48px;
    width: 25%;
    margin-bottom: 8px;
}

.bar {
    width: 6px;
    background-color: var(--glass-border);
    border-radius: 4px;
    transition: background-color 0.4s ease;
    opacity: 0.4;
}

.playing .bar {
    background: var(--text-heading);
    opacity: 1;
}

@keyframes eqFluidSmooth {
    0%   { height: 15%; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
    50%  { height: 100%; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
    100% { height: 15%; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
}

.playing .bar-1 { animation: eqFluidSmooth 1.4s infinite; }
.playing .bar-2 { animation: eqFluidSmooth 1.7s infinite 0.2s; }
.playing .bar-3 { animation: eqFluidSmooth 1.2s infinite 0.4s; }
.playing .bar-4 { animation: eqFluidSmooth 1.9s infinite 0.1s; }
.playing .bar-5 { animation: eqFluidSmooth 1.3s infinite 0.5s; }
.playing .bar-6 { animation: eqFluidSmooth 1.6s infinite 0.3s; }

/* Flat Pure Progress Fill - No Thumb Marker */
.progress-container {
    margin-bottom: 40px;
}

.progress-track {
    background: rgba(255, 255, 255, 0.1);
    height: 4px; 
    width: 100%;
    border-radius: 4px;
    position: relative;
    overflow: hidden; 
}

.progress-fill {
    background: var(--accent-progress);
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.1s linear;
}

/* Encapsulated Minimal Controls */
.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 8px;
}

/* Shared Button Logic */
.control-btn {
    background: transparent;
    border: none;
    color: var(--text-body);
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
    outline: none;
    border-radius: 50%;
}

/* Secondary Button Flat Icons (NO GLASS HOUSING) */
.control-btn:not(#ctrl-play) {
    width: 44px; height: 44px;
    font-size: 1.4rem;
    color: var(--text-secondary);
}

.control-btn:not(#ctrl-play):hover {
    color: var(--text-heading);
    transform: scale(1.04);
}

.control-btn:not(#ctrl-play):active {
    transform: scale(0.96);
}

/* Primary Play Button - Editorial Smoothness */
#ctrl-play {
    width: 68px;
    height: 68px;
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.1); /* Slightly pushed frostedness */
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text-heading);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.08), 0 4px 10px rgba(0,0,0,0.1); 
}

#ctrl-play:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

#ctrl-play:active, #ctrl-play.active.pressed {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.08);
}

.icon-svg { pointer-events: none; }

/* Status Bar */
.status-bar {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2.5px;
}

/* --- LEARN PANEL --- */
#learn-panel {
    position: absolute;
    left: 40px; 
    top: 50%;
    width: 440px; 
    height: auto;
    max-height: 75vh;
    overflow-y: auto;
    transform: translate(-20px, -50%) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.8s var(--curve-smooth);
    z-index: 20; 
}

#learn-panel::-webkit-scrollbar { width: 4px; }
#learn-panel::-webkit-scrollbar-track { background: transparent; }
#learn-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

#layout-wrapper.learn-mode #learn-panel {
    transform: translate(0, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

#layout-wrapper.learn-mode #player-window {
    transform: scale(0.92) translateX(260px); 
    z-index: 5; 
}

.learn-content {
    background: transparent;
    flex-grow: 1;
    padding: 0 32px 32px 32px;
    position: relative;
    z-index: 2;
}

.learn-header {
    margin-top: 32px;
    margin-bottom: 12px;
}

.learn-header h3 {
    font-size: 0.95rem;
    color: var(--text-heading);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.principles-list {
    list-style: none;
    margin-bottom: 24px;
}

.principles-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-body);
    line-height: 1.6;
}

.bullet {
    color: var(--accent-teal); 
    font-size: 1.2rem;
    margin-right: 12px;
    line-height: 1.2;
}

.context-text {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0px;
    color: var(--text-body);
}

/* High Contrast Box */
.highlight-box {
    background: rgba(0, 0, 0, 0.15); 
    border: 1px solid rgba(255,255,255,0.08);
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.highlight-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.highlight-text {
    font-size: 1.3rem;
    color: var(--text-heading);
    font-weight: 500;
    line-height: 1.4;
}

.learn-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    margin-bottom: 8px;
}

.nav-lesson-link {
    text-decoration: none;
}

.prev-btn, .next-btn {
    background: var(--glass-base);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 400;
    font-family: var(--font-stack);
    color: var(--text-heading);
    cursor: pointer;
    border-radius: 20px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.prev-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.prev-btn:active {
    transform: scale(0.96);
}

/* External Navigation */
.navigation-panel {
    position: absolute;
    bottom: 48px;
    right: 48px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.nav-buttons {
    display: flex;
    gap: 12px;
}

.nav-btn {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--glass-base);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    font-size: 1.1rem;
    color: var(--text-heading);
    cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.nav-btn:not([disabled]):hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.04);
}

.nav-btn:not([disabled]):active {
    transform: scale(0.96);
}

.nav-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}
