/* DESIGN SYSTEM - ZERO ANIMATIONS */
:root {
    --bg-base: #030303;
    --bg-panel: rgba(15, 15, 17, 0.7);
    --bg-panel-solid: #121214;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-sharp: rgba(255, 255, 255, 0.15);
    
    --text-primary: #FFFFFF;
    --text-secondary: #888890;
    --text-dim: #44444A;
    
    --accent-indigo: #818CF8;
    --accent-purple: #C084FC;
    --accent-gradient: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    
    --font-ui: 'Inter', sans-serif;
    --font-display: 'Sora', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-ui);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-sharp); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Ambient Glow */
.ambient-glow { position: fixed; border-radius: 50%; filter: blur(140px); opacity: 0.12; z-index: -1; pointer-events: none;}
.glow-1 { top: -20%; left: -10%; width: 60vw; height: 60vw; background: var(--accent-indigo); }
.glow-2 { bottom: -20%; right: -10%; width: 50vw; height: 50vw; background: var(--accent-purple); }

/* Grid Layout */
.app-container {
    width: 100%; max-width: 1500px; padding: 2rem;
    display: grid; grid-template-columns: 280px 1fr 360px; gap: 1.5rem; min-height: 100vh;
}

.panel {
    background: var(--bg-panel); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-sharp); border-radius: 20px; padding: 2rem;
    display: flex; flex-direction: column;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 10px 40px rgba(0,0,0,0.5);
}

/* Branding */
.brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 2.5rem; }
.brand-logo { width: 32px; height: 32px; background: var(--accent-gradient); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.brand-name { 
    font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; letter-spacing: -0.5px;
    background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* Stats */
.panel-subtitle { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 1.2rem; font-weight: 600;}
.stats-container { display: flex; flex-direction: column; gap: 1rem; }
.stats-grid { display: flex; flex-direction: column; gap: 1rem; }
.stat-card { background: rgba(0,0,0,0.3); padding: 1.2rem; border-radius: 12px; border: 1px solid var(--border-subtle); }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1; margin-bottom: 0.5rem;}
.stat-label { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;}
.btn-text { display: flex; align-items: center; gap: 0.5rem; background: none; border: none; color: var(--text-dim); cursor: pointer; margin-top: 1rem; font-size: 0.85rem; font-weight: 500;}
.btn-text:hover, .btn-text:active { color: #ef4444; }

/* Main Stage */
.main-stage { align-items: center; justify-content: center; position: relative; }

.mode-selector { display: flex; background: rgba(0,0,0,0.5); padding: 4px; border-radius: 12px; border: 1px solid var(--border-subtle); margin-bottom: 4rem; }
.mode-btn { background: transparent; border: none; color: var(--text-secondary); padding: 0.6rem 1.2rem; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 0.9rem;}
.mode-btn:hover { color: var(--text-primary); }
.mode-btn.active { background: var(--bg-panel-solid); color: var(--text-primary); border: 1px solid var(--border-sharp); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* Temporizador con ajuste dinámico de tamaño */
.timer-display {
    font-family: var(--font-display);
    font-size: clamp(4rem, 10vw, 12rem);
    font-weight: 700;
    line-height: 0.85;
    letter-spacing: -4px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 3.5rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
    width: 100%;
}
/* Clase aplicada por JS cuando muestra horas (ej. 01:00:00) */
.timer-display.long-format {
    font-size: clamp(3rem, 8vw, 8.5rem);
    letter-spacing: -2px;
}

.timer-controls { display: flex; gap: 1.5rem; align-items: center; }

.btn-play { 
    width: 88px; height: 88px; border-radius: 50%; border: none; 
    background: var(--text-primary); color: var(--bg-base); 
    display: flex; justify-content: center; align-items: center; cursor: pointer; 
}
.btn-play:hover, .btn-play:active { background: var(--accent-indigo); color: white; }

.btn-icon {
    width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border-sharp);
    background: transparent; color: var(--text-primary);
    display: flex; justify-content: center; align-items: center; cursor: pointer;
}
.btn-icon:hover, .btn-icon:active { background: var(--text-primary); color: var(--bg-base); }

.slogan { position: absolute; bottom: 2rem; color: var(--text-dim); font-size: 0.75rem; letter-spacing: 4px; font-weight: 600; text-align: center; width: 100%;}

/* Right Wing */
.right-wing { display: grid; grid-template-rows: 1fr 1fr; gap: 1.5rem; }
.sub-panel { background: var(--bg-panel); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--border-sharp); border-radius: 20px; padding: 1.5rem; display: flex; flex-direction: column; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);}
.panel-header { font-family: var(--font-display); font-size: 1rem; font-weight: 600; margin-bottom: 1.5rem; }

.scroll-container { flex-grow: 1; overflow-y: auto; padding-right: 5px; }

/* Tasks Custom UI */
.task-form { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
#task-input { flex-grow: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--border-subtle); padding: 0.7rem 1rem; color: white; border-radius: 8px; font-family: var(--font-ui); outline: none; }
#task-input:focus { border-color: var(--accent-indigo); background: rgba(0,0,0,0.6); }

.btn-action { background: var(--border-sharp); color: var(--text-primary); border: none; width: 44px; border-radius: 8px; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.btn-action:hover, .btn-action:active { background: var(--text-primary); color: var(--bg-base); }

.task-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.task-item { display: flex; align-items: center; gap: 1rem; background: rgba(0,0,0,0.2); padding: 0.7rem 1rem; border-radius: 8px; border: 1px solid transparent; }
.task-item:hover { border-color: var(--border-subtle); background: rgba(0,0,0,0.4);}

/* Custom Checkbox */
input[type="checkbox"] { 
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; border: 2px solid var(--text-dim); border-radius: 4px; cursor: pointer; 
    display: grid; place-content: center;
}
input[type="checkbox"]::before {
    content: ""; width: 10px; height: 10px; transform: scale(0);
    box-shadow: inset 1em 1em var(--bg-base); background-color: var(--bg-base);
    transform-origin: center; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type="checkbox"]:checked { background: var(--text-primary); border-color: var(--text-primary); }
input[type="checkbox"]:checked::before { transform: scale(1); }

.task-item.done { opacity: 0.4; }
.task-item.done span { text-decoration: line-through; }
.task-item button { background: none; border: none; color: var(--text-dim); cursor: pointer; margin-left: auto; display: flex;}
.task-item button:hover, .task-item button:active { color: #ef4444; }

/* Reproductor de Música Premium */
.upload-btn { display: flex; justify-content: center; align-items: center; gap: 0.8rem; background: rgba(0,0,0,0.3); border: 1px dashed var(--border-sharp); padding: 1rem; border-radius: 12px; cursor: pointer; color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;}
.upload-btn:hover, .upload-btn:active { border-color: var(--text-primary); color: var(--text-primary); background: rgba(0,0,0,0.6);}

.music-player { display: flex; flex-direction: column; gap: 1.2rem; margin-top: 1.5rem; background: rgba(0,0,0,0.2); padding: 1.5rem; border-radius: 16px; border: 1px solid var(--border-subtle); }
.track-info { display: flex; align-items: center; gap: 0.8rem; color: var(--text-primary); }
.track-name { font-size: 0.95rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player-controls { display: flex; justify-content: center; align-items: center; gap: 1.5rem; }
.btn-music { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; display: flex; justify-content: center; align-items: center; }
.btn-music:hover, .btn-music:active { color: var(--text-primary); }
.btn-music-main { width: 44px; height: 44px; background: var(--text-primary); color: var(--bg-base); border-radius: 50%; }
.btn-music-main:hover, .btn-music-main:active { background: var(--accent-indigo); color: white; }

.progress-wrapper { display: flex; align-items: center; gap: 0.8rem; font-size: 0.75rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.volume-wrapper { display: flex; align-items: center; gap: 0.8rem; color: var(--text-secondary); }

/* Custom Range Sliders */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; background: var(--text-primary); border-radius: 50%; }
input[type="range"]:active::-webkit-slider-thumb { background: var(--accent-indigo); transform: scale(1.2); }


/* =================================================
   RESPONSIVE DESIGN (Hyper-Optimized Mobile & Tablet)
   ================================================= */
@media (max-width: 1200px) {
    .app-container { 
        grid-template-columns: 1fr; 
        height: auto; 
        padding: 1.5rem;
    }
    .panel-left { order: 2; }
    .main-stage { order: 1; padding: 3rem 1.5rem; }
    .right-wing { order: 3; grid-template-columns: 1fr; grid-template-rows: auto auto; }
    
    .stats-grid { flex-direction: row; display: flex; gap: 1rem; }
    .stat-card { flex: 1; }
    .brand { justify-content: center; }
    
    .timer-display { font-size: clamp(6rem, 15vw, 10rem); }
    .timer-display.long-format { font-size: clamp(4.5rem, 11vw, 7.5rem); }
}

@media (max-width: 768px) {
    .app-container { padding: 1rem; gap: 1rem; }
    .panel { padding: 1.5rem; }
    
    .mode-selector { flex-wrap: wrap; justify-content: center; margin-bottom: 2rem;}
    
    .timer-display { font-size: clamp(4.5rem, 18vw, 7rem); letter-spacing: -2px; margin-bottom: 2.5rem;}
    .timer-display.long-format { font-size: clamp(3rem, 12vw, 5rem); letter-spacing: -1px; }
    
    .stats-grid { flex-direction: column; }
    .btn-text { justify-content: center; width: 100%; }
    
    .slogan { position: relative; bottom: 0; margin-top: 2rem; }
}