/* ===== RESET & VARIABLES ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== THEME TRANSITION ANIMATION ===== */
.theme-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999;
    opacity: 0;
}

.theme-overlay.animating {
    opacity: 1;
    animation: themeWipe 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.theme-overlay.light-to-dark {
    background: radial-gradient(circle at center, rgba(26,26,46,0.85) 0%, rgba(26,26,46,0.95) 100%);
}

.theme-overlay.dark-to-light {
    background: radial-gradient(circle at center, rgba(255,245,240,0.85) 0%, rgba(255,245,240,0.95) 100%);
}

@keyframes themeWipe {
    0% { clip-path: circle(0% at 50% 50%); }
    100% { clip-path: circle(150% at 50% 50%); }
}

/* Smooth transition untuk semua elemen theme-able */
body, .main-window, .sidebar, .combined-window, .timer-container, .stats-panel, 
.music-window, .quotes-content, .settings-modal, .playlist-item, .stat-card,
.btn, .music-btn, .stat-edit-input, .setting-item input {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, 
                box-shadow 0.4s ease, transform 0.3s ease;
}

:root {
    --pastel-orange: #FFB347; --pastel-cyan: #A8E6CF; --pastel-pink: #FFB7C5;
    --pastel-magenta: #FF9AA2; --pastel-lavender: #C7CEEA; --pastel-peach: #FFDAB9;
    --bg-light: #FFF5F0; --bg-dark: #1a1a2e; --text-light: #636E72; --text-dark: #DFE6E9;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif; min-height: 100vh;
    background: var(--bg-light); color: var(--text-light); overflow-x: hidden;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255,179,71,0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(168,230,207,0.4), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255,183,197,0.5), transparent);
    background-size: 100% 100%; background-attachment: fixed;
}
body.dark-mode { 
    background: var(--bg-dark); 
    /* HAPUS line: color: var(--text-dark); */
}

/* Terus tambahin ini */
body.dark-mode .container,
body.dark-mode .timer-container,
body.dark-mode .stats-panel,
body.dark-mode .combined-window,
body.dark-mode .music-player,
body.dark-mode .quotes-content,
body.dark-mode .window-header,
body.dark-mode .settings-modal,
body.dark-mode .sidebar,
body.dark-mode .main-window {
    color: var(--text-light);
}

/* ===== LAYOUT ===== */
.container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 20px; gap: 20px; flex-wrap: nowrap;
    text-align: center;
}

/* Sidebar */
.sidebar {
    flex: 0 0 auto; background: linear-gradient(180deg, var(--pastel-pink), var(--pastel-magenta));
    border-radius: 20px; padding: 20px; display: flex; flex-direction: column;
    gap: 15px; box-shadow: 0 8px 32px rgba(255,154,162,0.3); height: fit-content;
}
.sidebar-icon {
    width: 50px; height: 50px; background: white; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    font-size: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); transition: 0.3s;
}
.sidebar-icon:hover { transform: translateY(-3px) scale(1.1); }

/* Main Window */
.main-window {
    flex: 1 1 auto; max-width: 600px; min-width: 320px;
    background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-lavender));
    border-radius: 25px; padding: 30px; box-shadow: 0 10px 40px rgba(255,154,162,0.4);
    position: relative;
}
.window-header {
    background: rgba(255,255,255,0.6); border-radius: 15px 15px 0 0;
    padding: 15px 20px; display: flex; align-items: center; gap: 10px;
    margin: -30px -30px 20px -30px;
}
.window-btn { width: 12px; height: 12px; border-radius: 50%; background: var(--pastel-magenta); }
.window-btn:nth-child(2) { background: var(--pastel-orange); }
.window-btn:nth-child(3) { background: var(--pastel-cyan); }
.window-title { flex: 1; text-align: center; font-size: 14px; color: var(--text-light); font-weight: 600; margin-right: 40px; }

/* Timer & Stats Views */
.timer-container, .stats-panel {
    background: white; border-radius: 20px; padding: 40px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1); animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.timer-container::before { content: ''; position: absolute; top: 10px; left: 20px; font-size: 30px; opacity: 0.5; }
.timer-container::after { content: '✨'; position: absolute; top: 10px; right: 20px; font-size: 30px; opacity: 0.5; }
.timer-label { font-size: 18px; margin-bottom: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; }
.timer-display { font-size: 80px; font-weight: bold; color: var(--pastel-magenta); font-family: monospace; margin: 20px 0; letter-spacing: 5px; }
.timer-controls { display: flex; gap: 15px; justify-content: center; margin-top: 30px; }
.mode-indicator { margin-top: 20px; padding: 10px 20px; background: var(--pastel-peach); border-radius: 20px; display: inline-block; font-weight: 600; }

/* Stats */
.stats-panel { display: flex; flex-direction: column; gap: 20px; padding: 30px; }
.stat-card {
    background: linear-gradient(135deg, var(--pastel-peach), var(--pastel-lavender));
    border-radius: 15px; padding: 15px 20px; display: flex; align-items: center; gap: 15px;
}
.stat-icon { font-size: 32px; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: white; border-radius: 12px; flex-shrink: 0; }
.stat-info { flex: 1; }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.stat-edit-input { width: 55px; padding: 6px; border: 2px solid var(--pastel-cyan); border-radius: 8px; text-align: center; font-weight: bold; color: var(--pastel-magenta); background: white; outline: none; font-size: 14px; }
.stat-edit-btn { padding: 5px 10px; background: var(--pastel-peach); border: none; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 700; transition: 0.2s; }
.stat-edit-btn:hover { background: var(--pastel-magenta); color: white; }

/* Side Panel */
.side-panel { flex: 0 0 auto; width: 380px; max-height: 90vh; }
.combined-window {
    background: var(--pastel-cyan); border-radius: 20px; padding: 20px;
    display: flex; flex-direction: column; gap: 15px; max-height: 100%; overflow-y: auto;
}
.quotes-header { font-size: 16px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.quotes-content { background: white; border-radius: 15px; padding: 15px; text-align: center; font-style: italic; }
.btn-new-quote { margin-top: 10px; padding: 8px 16px; background: white; border: 2px solid var(--pastel-magenta); border-radius: 20px; color: var(--pastel-magenta); font-weight: 600; cursor: pointer; }
.btn-new-quote:hover { background: var(--pastel-magenta); color: white; }

.music-window { background: rgba(255,255,255,0.9); border-radius: 15px; padding: 15px; }
.music-header { font-size: 16px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.music-player { background: white; border-radius: 15px; padding: 15px; }
.now-playing { text-align: center; margin-bottom: 15px; }
.music-controls { display: flex; justify-content: center; gap: 15px; margin-bottom: 15px; }
.music-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--pastel-cyan); color: white; cursor: pointer; transition: 0.3s; }
.music-btn:hover { transform: scale(1.1); background: var(--pastel-magenta); }
.music-btn.play { width: 50px; height: 50px; background: linear-gradient(135deg, var(--pastel-orange), var(--pastel-magenta)); }
.playlist { max-height: 200px; overflow-y: auto; }
.playlist-item { padding: 8px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.playlist-item:hover { background: var(--pastel-peach); }
.playlist-item.active { background: var(--pastel-cyan); color: white; }
.playlist-item-number { width: 20px; height: 20px; background: rgba(255,255,255,0.5); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; }

/* Buttons */
.btn { padding: 12px 30px; border: none; border-radius: 25px; font-size: 16px; font-weight: 600; cursor: pointer; transition: 0.3s; }
.btn-start { background: var(--pastel-cyan); color: white; }
.btn-pause { background: var(--pastel-orange); color: white; }
.btn-reset { background: var(--pastel-pink); color: white; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }

/* Modal */
.modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); z-index: 998; display: none; opacity: 0; transition: 0.3s; }
.modal-backdrop.show { display: block; opacity: 1; }
.settings-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); background: white; border-radius: 20px; padding: 30px; width: 320px; box-shadow: 0 15px 40px rgba(0,0,0,0.2); z-index: 999; display: none; opacity: 0; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.settings-modal.show { display: block; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal-close { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-light); }
.setting-item { margin-bottom: 15px; }
.setting-item label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.setting-item input { width: 100%; padding: 8px; border: 2px solid var(--pastel-cyan); border-radius: 8px; outline: none; }

/* Scrollbar & Responsive */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--pastel-magenta); border-radius: 10px; }
@media (max-width: 1100px) {
    .container { flex-direction: column; align-items: center; }
    .sidebar { flex-direction: row; }
    .side-panel { width: 100%; max-width: 500px; }
    .main-window { width: 100%; }
}

/* Progress Bar Music Player - PASTIKAN ADA INI */
.music-player .progress-bar {
    width: 100%; 
    height: 8px; 
    background: rgba(0,0,0,0.15); 
    border-radius: 10px; 
    margin: 15px 0; 
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.music-player .progress {
    height: 100%; 
    background: linear-gradient(90deg, var(--pastel-cyan) 0%, var(--pastel-magenta) 100%);
    width: 0%; 
    transition: width 0.5s linear;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255,154,162,0.5);
}

/* Dark mode - biar progress bar tetep keliatan */
body.dark-mode .music-player .progress-bar {
    background: rgba(255,255,255,0.2);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

body.dark-mode .music-player .progress {
    box-shadow: 0 0 10px rgba(255,154,162,0.7);
}
/* Style Tombol Confirm di Modal */
.btn-confirm {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: linear-gradient(135deg, var(--pastel-magenta) 0%, var(--pastel-orange) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 154, 162, 0.4);
}

.btn-confirm:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 154, 162, 0.6);
}