/* ============================================
   SHIFT PLANNER — UI FOUNDATION
============================================ */


/* ============================================
   THEME VARIABLES
============================================ */

:root {

    --page-bg: #f6f7f9;
    --surface: #ffffff;

    --text: #1f2933;
    --text-secondary: #374151;
    --muted: #6b7280;
    --subtle: #8a929d;

    --border: #e5e7eb;
    --border-light: #edf0f2;

    --hover: #f7f8f9;
    --active: #f1f2f3;

    --accent: #2563eb;

}


/* ============================================
   LIGHT
============================================ */

body[data-theme="light"] {

    --page-bg: #f6f7f9;
    --surface: #ffffff;

    --text: #1f2933;
    --text-secondary: #374151;
    --muted: #6b7280;
    --subtle: #8a929d;

    --border: #e5e7eb;
    --border-light: #edf0f2;

    --hover: #f7f8f9;
    --active: #f1f2f3;

    --accent: #2563eb;

}


/* ============================================
   DARK
============================================ */

body[data-theme="dark"] {

    --page-bg: #111827;
    --surface: #1f2937;

    --text: #f9fafb;
    --text-secondary: #e5e7eb;
    --muted: #9ca3af;
    --subtle: #9ca3af;

    --border: #374151;
    --border-light: #374151;

    --hover: #273449;
    --active: #374151;

    --accent: #60a5fa;

}


/* ============================================
   PINK
============================================ */

body[data-theme="pink"] {

    --page-bg: #fff7fa;
    --surface: #ffffff;

    --text: #3b1f2b;
    --text-secondary: #5a3042;
    --muted: #8a6473;
    --subtle: #a27c8b;

    --border: #f1d5df;
    --border-light: #f6e5eb;

    --hover: #fff1f6;
    --active: #fce4ed;

    --accent: #d9467a;

}


/* ============================================
   PURPLE
============================================ */

body[data-theme="purple"] {

    --page-bg: #faf8ff;
    --surface: #ffffff;

    --text: #2f2540;
    --text-secondary: #493b5e;
    --muted: #766a89;
    --subtle: #9186a3;

    --border: #e4ddf1;
    --border-light: #eee9f6;

    --hover: #f6f2fc;
    --active: #ebe4f7;

    --accent: #7c5cff;

}


/* ============================================
   BLUE
============================================ */

body[data-theme="blue"] {

    --page-bg: #f5f9ff;
    --surface: #ffffff;

    --text: #1f2f43;
    --text-secondary: #354b63;
    --muted: #65758b;
    --subtle: #8291a4;

    --border: #dce7f5;
    --border-light: #e9f0f8;

    --hover: #eef5fd;
    --active: #e1edf9;

    --accent: #3b82f6;

}


/* ============================================
   RESET
============================================ */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    background: var(--page-bg);
    color: var(--text);

    -webkit-font-smoothing: antialiased;

    transition:
        background 0.2s ease,
        color 0.2s ease;

}


/* ============================================
   APP
============================================ */

.app {

    width: 100%;
    max-width: 700px;
    min-height: 100vh;

    margin: 0 auto;

    padding:
        0
        18px
        90px;

    background: var(--page-bg);

}


/* ============================================
   HEADER
============================================ */

.app-header {

    padding:
        22px
        2px
        18px;

}

.app-title {

    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;

    letter-spacing: -0.02em;

}

.app-date {

    margin-top: 5px;

    font-size: 14px;
    line-height: 1.3;

    color: var(--muted);

}


/* ============================================
   CONTENT
============================================ */

.app-content {
    width: 100%;
}


/* ============================================
   SCREEN
============================================ */

.screen {

    display: flex;
    flex-direction: column;

    gap: 20px;

}


/* ============================================
   GENERAL SECTION
============================================ */

.section {

    display: flex;
    flex-direction: column;

    gap: 9px;

}

.section-title {

    padding: 0 2px;

    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;

    color: var(--text-secondary);

}


/* ============================================
   TODAY — SHIFT SUMMARY
============================================ */

.shift-card {

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 12px;

    padding: 20px;

}

.shift-card-top {

    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 20px;

}

.shift-type {

    font-size: 27px;
    line-height: 1.15;
    font-weight: 700;

    letter-spacing: -0.025em;

}

.shift-status {

    margin-top: 6px;

    font-size: 14px;
    line-height: 1.3;

    color: var(--muted);

}

.shift-time {

    text-align: right;

    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;

    white-space: nowrap;

    color: var(--text-secondary);

}


/* ============================================
   NEXT EVENT
============================================ */

.next-card {

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 12px;

    padding: 16px 18px;

}

.next-label {

    font-size: 11px;
    line-height: 1.2;

    text-transform: uppercase;
    letter-spacing: 0.07em;

    color: var(--muted);

}

.next-event {

    margin-top: 5px;

    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;

    letter-spacing: -0.015em;

}

.next-time {

    margin-top: 4px;

    font-size: 14px;
    line-height: 1.3;

    color: var(--muted);

}


/* ============================================
   TIMELINE
============================================ */

.timeline {

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 12px;

    padding:
        2px
        18px;

}

.timeline-event {

    display: grid;

    grid-template-columns: 62px 1fr;

    gap: 14px;

    padding:
        15px
        0;

    border-bottom:
        1px solid var(--border-light);

}

.timeline-event:last-child {
    border-bottom: none;
}

.timeline-time {

    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;

    color: var(--muted);

}

.timeline-name {

    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;

    color: var(--text);

}


/* ============================================
   REST DAY
============================================ */

.rest-card {

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 12px;

    padding:
        30px
        20px;

    text-align: center;

}

.rest-title {

    font-size: 25px;
    line-height: 1.2;
    font-weight: 700;

    letter-spacing: -0.02em;

}

.rest-subtitle {

    margin-top: 7px;

    font-size: 14px;
    line-height: 1.4;

    color: var(--muted);

}


/* ============================================
   PLACEHOLDER
============================================ */

.placeholder {

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 12px;

    padding: 22px 20px;

}

.placeholder h2 {

    margin:
        0
        0
        8px;

    font-size: 22px;
    line-height: 1.2;

}

.placeholder p {

    margin: 0;

    font-size: 14px;
    line-height: 1.5;

    color: var(--muted);

}


/* ============================================
   BOTTOM NAVIGATION
============================================ */

.bottom-nav {

    position: fixed;

    left: 50%;
    bottom: 0;

    transform: translateX(-50%);

    width: 100%;
    max-width: 700px;

    height: 64px;

    display: flex;

    align-items: stretch;
    justify-content: center;

    background: var(--surface);

    border-top:
        1px solid var(--border);

    z-index: 1000;

}

.nav-button {

    flex: 1;

    max-width: 175px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    border: none;
    outline: none;

    background: transparent;

    padding: 6px 4px;

    color: var(--subtle);

    font-family: inherit;
    font-size: inherit;

    cursor: pointer;

    -webkit-appearance: none;
    appearance: none;

    -webkit-tap-highlight-color: transparent;

}

.nav-button.active {
    color: var(--text);
}

.nav-icon {

    display: block;

    height: 20px;

    font-size: 17px;
    line-height: 20px;

}

.nav-label {

    display: block;

    margin-top: 3px;

    font-size: 11px;
    line-height: 1.2;

    font-weight: 500;

}

.nav-button:hover {
    background: var(--hover);
}


/* ============================================
   DESKTOP
============================================ */

@media (min-width: 701px) {

    body {
        background: #eef0f3;
    }

    body[data-theme="dark"] {
        background: #0b1120;
    }

    .app {
        background: var(--page-bg);
    }

    .bottom-nav {

        border-radius:
            12px
            12px
            0
            0;

    }

}


/* ============================================
   CALENDAR
============================================ */

.calendar-screen {

    display: flex;
    flex-direction: column;

    gap: 16px;

}


/* ============================================
   CALENDAR HEADER
============================================ */

.calendar-header {

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding:
        2px
        2px
        4px;

}

.calendar-month {

    font-size: 23px;
    line-height: 1.2;
    font-weight: 700;

    letter-spacing: -0.02em;

}

.calendar-nav {

    display: flex;

    gap: 6px;

}

.calendar-nav-button {

    width: 38px;
    height: 38px;

    padding: 0;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background: var(--surface);

    color: var(--text-secondary);

    font-family: inherit;

    font-size: 18px;
    font-weight: 600;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;

}

.calendar-nav-button:hover {
    background: var(--hover);
}


/* ============================================
   CALENDAR GRID
============================================ */

.calendar-grid {

    display: grid;

    grid-template-columns:
        repeat(7, minmax(0, 1fr));

    gap: 4px;

    width: 100%;

}


/* ============================================
   WEEKDAY HEADINGS
============================================ */

.calendar-weekday {

    padding:
        5px
        2px
        7px;

    text-align: center;

    font-size: 10px;
    line-height: 1.2;

    font-weight: 700;

    color: var(--subtle);

    text-transform: uppercase;

    letter-spacing: 0.03em;

}


/* ============================================
   CALENDAR DAY
============================================ */

.calendar-day {

    width: 100%;
    min-height: 84px;

    padding:
        8px
        7px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background: var(--surface);

    color: var(--text);

    text-align: left;

    font-family: inherit;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;

    transition:
        background 0.1s ease,
        border-color 0.1s ease;

}

.calendar-day:hover {
    background: var(--hover);
}


/* ============================================
   EMPTY CELLS
============================================ */

.calendar-day.empty {

    background: transparent;

    border-color: transparent;

    cursor: default;

}

.calendar-day.empty:hover {
    background: transparent;
}


/* ============================================
   DATE NUMBER
============================================ */

.calendar-date {

    font-size: 13px;
    line-height: 1.2;

    font-weight: 700;

    color: var(--text-secondary);

}


/* ============================================
   SHIFT NAME
============================================ */

.calendar-shift {

    margin-top: 7px;

    font-size: 12px;
    line-height: 1.2;

    font-weight: 700;

    color: var(--text);

}


/* ============================================
   SHIFT TIME
============================================ */

.calendar-time {

    margin-top: 4px;

    font-size: 10px;
    line-height: 1.2;

    color: var(--muted);

}


/* ============================================
   REST DAYS
============================================ */

.calendar-day.rest {

    background: var(--hover);

    border-color: var(--border);

}

.calendar-day.rest .calendar-shift {
    color: var(--muted);
}


/* ============================================
   WORK SHIFTS
============================================ */

.calendar-day.day,
.calendar-day.training,
.calendar-day.late,
.calendar-day.night {

    background: var(--surface);

}


/* ============================================
   TODAY
============================================ */

.calendar-day.today {

    border:
        2px solid var(--accent);

    padding:
        7px
        6px;

}


/* ============================================
   SELECTED DAY
============================================ */

.calendar-day.selected {

    background: var(--text);

    border-color: var(--text);

    color: var(--page-bg);

}

.calendar-day.selected .calendar-date,
.calendar-day.selected .calendar-shift,
.calendar-day.selected .calendar-time {

    color: var(--page-bg);

}


/* ============================================
   SMALL SCREENS
============================================ */

@media (max-width: 500px) {

    .calendar-grid {
        gap: 3px;
    }

    .calendar-day {

        min-height: 72px;

        padding:
            7px
            5px;

        border-radius: 8px;

    }

    .calendar-date {
        font-size: 12px;
    }

    .calendar-shift {

        margin-top: 6px;

        font-size: 10px;

    }

    .calendar-time {
        font-size: 9px;
    }

    .calendar-weekday {
        font-size: 9px;
    }

}


/* ============================================
   VERY SMALL SCREENS
============================================ */

@media (max-width: 380px) {

    .calendar-day {

        min-height: 64px;

        padding:
            6px
            4px;

    }

    .calendar-shift {
        font-size: 9px;
    }

    .calendar-time {
        font-size: 8px;
    }

}


/* ============================================
   SETTINGS
============================================ */

.settings-card {

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 12px;

    overflow: hidden;

}


.settings-row {

    display: flex;

    align-items: center;
    justify-content: space-between;

    width: 100%;

    min-height: 72px;

    padding:
        15px
        18px;

    border: none;

    border-bottom:
        1px solid var(--border-light);

    background: var(--surface);

    color: var(--text);

    font-family: inherit;

    text-align: left;

}


.settings-row:last-child {
    border-bottom: none;
}


.settings-row-content {

    min-width: 0;

}


.settings-label {

    font-size: 15px;
    line-height: 1.35;

    font-weight: 600;

    color: var(--text);

}


.settings-value {

    margin-top: 3px;

    font-size: 14px;
    line-height: 1.3;

    color: var(--muted);

}


.settings-description {

    margin-top: 3px;

    font-size: 13px;
    line-height: 1.3;

    color: var(--muted);

}


.settings-button {

    cursor: pointer;

    -webkit-appearance: none;
    appearance: none;

    -webkit-tap-highlight-color: transparent;

    transition:
        background 0.1s ease;

}


.settings-button:hover {
    background: var(--hover);
}


.settings-button:active {
    background: var(--active);
}


.settings-chevron {

    flex-shrink: 0;

    margin-left: 16px;

    font-size: 22px;
    line-height: 1;

    color: var(--subtle);

}


/* ============================================
   SETTINGS TOGGLE
============================================ */

.settings-toggle {

    position: relative;

    display: inline-block;

    width: 44px;
    height: 26px;

    flex-shrink: 0;

    cursor: pointer;

}


.settings-toggle input {

    opacity: 0;

    width: 0;
    height: 0;

}


.settings-toggle-slider {

    position: absolute;

    inset: 0;

    background: #d1d5db;

    border-radius: 999px;

    transition:
        background 0.2s ease;

}


.settings-toggle-slider::before {

    content: "";

    position: absolute;

    width: 20px;
    height: 20px;

    left: 3px;
    top: 3px;

    background: #ffffff;

    border-radius: 50%;

    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.2);

    transition:
        transform 0.2s ease;

}


.settings-toggle input:checked + .settings-toggle-slider {

    background: var(--accent);

}


.settings-toggle input:checked + .settings-toggle-slider::before {

    transform:
        translateX(18px);

}


/* ============================================
   THEME ROW
============================================ */

.theme-row {

    min-height: 72px;

}


/* ============================================
   CHANGE BUTTON
============================================ */

.theme-change-button {

    flex-shrink: 0;

    border: none;

    background: transparent;

    color: var(--accent);

    font-family: inherit;

    font-size: 14px;
    font-weight: 600;

    padding:
        8px
        4px
        8px
        12px;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;

}


.theme-change-button:hover {
    opacity: 0.75;
}


/* ============================================
   THEME PICKER
============================================ */

.theme-picker {

    padding:
        14px
        18px
        18px;

    background: var(--hover);

    border-top:
        1px solid var(--border-light);

}


.theme-picker-label {

    margin-bottom: 10px;

    font-size: 12px;
    line-height: 1.3;

    font-weight: 600;

    color: var(--muted);

}


/* ============================================
   THEME PILLS
============================================ */

.theme-options {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

}


.theme-pill {

    display: inline-flex;

    align-items: center;

    gap: 7px;

    min-height: 36px;

    padding:
        6px
        11px;

    border:
        1px solid var(--border);

    border-radius: 999px;

    background: var(--surface);

    color: var(--text);

    font-family: inherit;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;

}


.theme-pill:hover {
    background: var(--hover);
}


.theme-pill.selected {

    border-color: var(--accent);

    background: var(--surface);

}


.theme-pill-colour {

    width: 14px;
    height: 14px;

    flex-shrink: 0;

    border-radius: 50%;

    background:
        var(--pill-colour);

}


.theme-pill-name {
    line-height: 1;
}


.theme-pill-check {

    margin-left: 1px;

    color: var(--accent);

    font-size: 13px;
    font-weight: 700;

}


/* ============================================
   SETTINGS SCREEN SPACING
============================================ */

.settings-screen {
    gap: 20px;
}