/* ---------- RESET & BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0b0e17;
    color: #e5e9f0;
    padding: 2rem 1.5rem;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1000px;
    width: 100%;
    background: #141a26;
    padding: 2rem;
    border-radius: 2rem;
    border: 1px solid #2a3344;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    transition: background 0.3s, border 0.3s;
}

/* ---------- LIGHT THEME ---------- */
body.light-theme {
    background: #f0f4f8;
    color: #1a202c;
}
body.light-theme .container {
    background: #ffffff;
    border-color: #d0d9e6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
body.light-theme .row {
    background: #f7fafc;
    border-color: #e2e8f0;
}
body.light-theme .row:hover {
    background: #edf2f7;
}
body.light-theme .row-gap {
    background: #edf2f7;
}
body.light-theme .time {
    color: #4a5568;
}
body.light-theme .activity .label {
    color: #2d3748;
}
body.light-theme .activity .sub {
    background: #e2e8f0;
    color: #4a5568;
}
body.light-theme .stat-card {
    background: #f7fafc;
    border-color: #e2e8f0;
}
body.light-theme .progress-track {
    background: #e2e8f0;
}
body.light-theme .tip {
    background: #f7fafc;
    border-color: #e2e8f0;
    color: #4a5568;
}
body.light-theme .header-actions .btn-icon {
    background: #e2e8f0;
    color: #2d3748;
}
body.light-theme .header-actions .btn-icon:hover {
    background: #cbd5e0;
}

/* ---------- HEADER ---------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #2a3344;
    padding-bottom: 1.2rem;
}
.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f0c27f, #fc5c7d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header h1 i {
    -webkit-text-fill-color: initial;
    color: #facc15;
    margin-right: 6px;
}
.subhead {
    font-size: 0.9rem;
    color: #8892a8;
    margin-top: 2px;
}
.header-actions {
    display: flex;
    gap: 10px;
}
.btn-icon {
    background: #1f2a3a;
    border: none;
    color: #cbd5e1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover {
    background: #2d3b50;
    transform: scale(1.05);
}

/* ---------- LEGEND ---------- */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 2rem;
    justify-content: center;
    background: #10171f;
    padding: 0.6rem 1.5rem;
    border-radius: 60px;
    border: 1px solid #293241;
    font-size: 0.85rem;
    color: #b9c2d4;
}
.dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    margin-right: 4px;
    vertical-align: middle;
}
.dot.deep  { background: #f97316; }
.dot.light { background: #38bdf8; }
.dot.break { background: #4ade80; }
.dot.gap   { background: #a78bfa; }
.dot.heavy { background: #ef4444; }

/* ---------- TIMELINE ROWS ---------- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 2rem;
}
.row {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    align-items: center;
    gap: 10px;
    background: #1a2330;
    border-radius: 12px;
    padding: 8px 16px 8px 16px;
    border-left: 4px solid transparent;
    transition: 0.2s ease;
    cursor: default;
}
.row:hover {
    background: #222e3e;
    transform: scale(1.01);
}
/* Color borders */
.row-deep    { border-left-color: #f97316; }
.row-light   { border-left-color: #38bdf8; }
.row-break   { border-left-color: #4ade80; }
.row-gap     { border-left-color: #a78bfa; border-left-style: dashed; background: #111a24; }
.row-heavy   { border-left-color: #ef4444; }

/* Completed state (toggled by JS) */
.row.completed {
    opacity: 0.55;
    background: #0f1620;
}
.row.completed .activity .label {
    text-decoration: line-through;
    color: #6b7a94;
}
.row.completed .check i {
    color: #4ade80;
}

.time {
    font-size: 0.85rem;
    font-weight: 600;
    color: #a0abc0;
    white-space: nowrap;
}
.activity {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.activity .icon {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}
.activity .label {
    font-size: 0.92rem;
    font-weight: 500;
    color: #eef2f8;
}
.activity .sub {
    font-size: 0.75rem;
    color: #7f8aa2;
    background: #0f1620;
    padding: 0.1rem 0.7rem;
    border-radius: 20px;
    white-space: nowrap;
}
.check {
    display: flex;
    justify-content: flex-end;
}
.check i {
    font-size: 1.4rem;
    color: #4a5568;
    cursor: pointer;
    transition: 0.15s;
}
.check i:hover {
    color: #cbd5e1;
    transform: scale(1.15);
}
.check i.fa-square-check {
    color: #4ade80;
}

/* ---------- STATS PANEL ---------- */
.stats-panel {
    background: #10171f;
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #293241;
    margin-top: 0.5rem;
}
.stats-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 1rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}
.stat-card {
    background: #1a2330;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid #293241;
    text-align: center;
}
.stat-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8aa2;
}
.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #f0f4f8;
    margin-top: 2px;
}
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}
.progress-track {
    flex: 1;
    height: 10px;
    background: #293241;
    border-radius: 20px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #facc15, #fc5c7d);
    border-radius: 20px;
    transition: width 0.4s ease;
}
#progressText {
    font-size: 0.9rem;
    font-weight: 700;
    color: #cbd5e1;
    min-width: 45px;
    text-align: right;
}
.btn-primary {
    background: linear-gradient(135deg, #fc5c7d, #f97316);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.7rem 1.5rem;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(252, 92, 125, 0.4);
}

/* ---------- TIP ---------- */
.tip {
    margin-top: 1.8rem;
    font-size: 0.85rem;
    color: #6a7a92;
    text-align: center;
    border: 1px dashed #2a3344;
    border-radius: 30px;
    padding: 0.8rem 1.2rem;
    background: #10171f;
    line-height: 1.6;
}
.tip strong {
    color: #facc15;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 700px) {
    body { padding: 1rem; }
    .container { padding: 1.2rem; }
    .row { grid-template-columns: 60px 1fr 40px; padding: 6px 10px; gap: 4px; }
    .time { font-size: 0.7rem; }
    .activity .label { font-size: 0.8rem; }
    .activity .sub { display: none; }
    .header h1 { font-size: 1.4rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .legend { gap: 0.5rem; padding: 0.5rem 0.8rem; border-radius: 30px; font-size: 0.75rem; }
}
@media (max-width: 450px) {
    .row { grid-template-columns: 50px 1fr 30px; }
    .activity .icon { font-size: 0.9rem; width: 18px; }
}