/* ====== Start of Day Design (Pastel Timeline) ====== */
:root {
    --bg-color: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #8E9298;

    /* Pastel Colors */
    --pastel-blue: #EFF6FF;
    --pastel-purple: #F3E8FF;
    --pastel-pink: #FCE7F3;
    --pastel-yellow: #FEF3C7;
    --pastel-green: #DCFCE7;

    --timeline-line: #E5E7EB;
    --border-radius: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-primary);
    padding: 24px;
    min-height: 100vh;
}

.app-container {
    max-width: 440px;
    margin: 0 auto;
}

/* ====== Header Section ====== */
.nav-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.nav-btn {
    width: 48px;
    height: 48px;
    border: 1px solid #F3F4F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
}

.header-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.header-title-row h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.play-btn {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 14px;
}

.time-range {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 500;
}

.header-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 32px;
}

/* ====== Timeline Layout ====== */
.timeline-container {
    position: relative;
    padding-right: 10px;
}

/* The vertical line on the right side connecting checkboxes */
.timeline-line {
    position: absolute;
    top: 30px;
    right: 14px;
    bottom: 30px;
    width: 2px;
    background: #E5E7EB;
    z-index: 0;
}

/* ====== Habit Card ====== */
.habit-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.habit-card {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 20px;
    gap: 16px;
    /* Default bg, will be overridden inline */
    background: #F3F4F6;
    transition: transform 0.1s;
}

.habit-card:active {
    transform: scale(0.98);
}

.habit-icon-box {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.habit-info {
    flex: 1;
}

.habit-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.habit-desc {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.5);
}

/* Right side stats on the card */
.habit-duration {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

/* Checkbox (separate from card, on the timeline) */
.timeline-check {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
    /* above line */
}

.timeline-check.checked {
    background: #3B82F6;
    border-color: #3B82F6;
    color: white;
}

.timeline-check.skipped {
    background: #EF4444;
    border-color: #EF4444;
    color: white;
}

/* ====== Modal (Edit/Add) ====== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: none;
    align-items: flex-end;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 24px;
}

.modal h3 {
    text-align: center;
    margin-bottom: 24px;
}

.color-pills {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.color-pill {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-pill.selected {
    border-color: #000;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    max-height: 120px;
    overflow-y: auto;
}

.emoji-btn {
    font-size: 20px;
    text-align: center;
    padding: 8px 0;
    border-radius: 8px;
    cursor: pointer;
}

.emoji-btn.selected {
    background: #F3F4F6;
}

/* Floating Action Button for Add */
.fab {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 10;
}