/* ============================================
   Wheaton Family Practice Vacation Portal
   Duly Health & Care — Editorial Medical Theme
   ============================================ */

/* --- Mock Mode Warning Banner --- */
.mock-warning-banner {
    background: #FFF3CD;
    color: #664D03;
    border-bottom: 2px solid #FFCA2C;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Duly Health exact brand palette */
    --oxford:       #003B4A;
    --oxford-80:    rgba(0, 59, 74, 0.80);
    --oxford-20:    rgba(0, 59, 74, 0.20);
    --oxford-10:    rgba(0, 59, 74, 0.10);
    --oxford-06:    rgba(0, 59, 74, 0.06);
    --sky:          #008298;
    --sky-10:       rgba(0, 130, 152, 0.10);
    --sky-15:       rgba(0, 130, 152, 0.15);
    --green:        #2E8540;
    --green-12:     rgba(46, 133, 64, 0.12);
    --error:        #C62828;
    --error-08:     rgba(198, 40, 40, 0.08);

    /* Neutrals */
    --white:        #ffffff;
    --bg:           #ffffff;
    --card-bg:      #EEF1F5;
    --text:         #0D1F26;
    --text-muted:   #4a6670;
    --border:       rgba(0, 59, 74, 0.14);

    /* Typography */
    --font:         'Outfit', system-ui, sans-serif;

    /* Duly asymmetric radius — signature diagonal rhythm */
    --radius-card:  0px 32px 0px 32px;
    --radius-btn:   5px;
    --radius-pill:  999px;
    --radius-sm:    10px;

    /* Shadows — removed per Duly design language (color-block architecture) */
    --shadow-sm:    none;
    --shadow-md:    none;
    --shadow-lg:    none;

    /* Motion */
    --ease:         cubic-bezier(0.4, 0, 0.2, 1);
    --transition:   all 0.22s var(--ease);
}

html { font-size: 16px; }

/* ============================================
   SPLIT-WEIGHT TYPOGRAPHY — Duly signature
   Adjacent bold/light weights in same heading
   ============================================ */
.heading-bold  { font-weight: 900; }
.heading-light { font-weight: 300; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    min-height: 100vh;
}

[x-cloak] { display: none !important; }

/* ============================================
   DULY ACCENT DIVIDER — signature split bar
   Navy 2/6 + Teal 4/6
   ============================================ */
.duly-divider {
    display: flex;
    height: 6px;
    width: 100%;
}
.duly-divider-navy {
    background: var(--oxford);
    width: 33.333%;
    border-radius: 0 0 0 999px;
}
.duly-divider-teal {
    background: var(--sky);
    flex: 1;
    border-radius: 0 0 999px 0;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
#login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 2rem;
}

#login-container {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    overflow: hidden;
}

.login-header {
    background: var(--oxford);
    padding: 2rem 2rem 1.5rem;
    position: relative;
}

.login-header h1 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--white);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.login-header h2 {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 0.375rem;
}

.login-body {
    padding: 2rem;
}

.login-form {}

.form-group {
    margin-bottom: 1.125rem;
}

/* Password peek toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 2.75rem;
}

.btn-peek {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.4;
    transition: var(--transition);
    padding: 0.25rem;
    line-height: 1;
}

.btn-peek:hover { opacity: 0.85; }

.error-message {
    color: var(--error);
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--error-08);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--error);
}

.btn-full {
    width: 100%;
    margin-top: 0.25rem;
}

/* ============================================
   HEADER — floating pill, centered title
   ============================================ */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left { width: 120px; }

header h1 {
    font-size: 1rem;
    color: var(--oxford);
    letter-spacing: -0.01em;
    text-align: center;
    /* Weight handled by .heading-bold / .heading-light spans */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 120px;
    justify-content: flex-end;
}

.doctor-badge {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.btn-logout {
    background: transparent;
    color: var(--oxford);
    border: 2px solid var(--oxford-20);
    padding: 0.3rem 0.875rem;
    border-radius: var(--radius-btn);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.btn-logout:hover {
    border-color: var(--sky);
    background: var(--sky-10);
    color: var(--sky);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
main {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   CALENDAR CONTAINER
   ============================================ */
#calendar-container {
    flex: 1;
    min-width: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.25rem;
    overflow: hidden;
}

/* Custom nav bar */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.calendar-nav-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--oxford);
    letter-spacing: -0.03em;
    min-width: 5rem;
    text-align: center;
}

/* Ghost outlined nav buttons — Duly squared style */
.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 2px solid var(--oxford-20);
    border-radius: var(--radius-btn);
    color: var(--oxford);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    font-family: var(--font);
}

.btn-nav:hover {
    border-color: var(--sky);
    background: var(--sky-10);
    color: var(--sky);
    transform: translateY(-1px);
}

.btn-nav-today {
    width: auto;
    padding: 0 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ============================================
   FULLCALENDAR OVERRIDES
   ============================================ */

/* Strip default borders */
.fc-theme-standard td,
.fc-theme-standard th {
    border: none;
}
.fc-theme-standard .fc-scrollgrid {
    border: none;
}

/* Hide default toolbar */
.fc .fc-header-toolbar {
    display: none !important;
}

/* Day cell hover — soft rounded target */
.fc .fc-daygrid-day-frame {
    margin: 2px;
    border-radius: 10px;
    transition: background 0.15s var(--ease);
    position: relative;
}

.fc .fc-daygrid-day:hover .fc-daygrid-day-frame {
    background: var(--sky-10);
    cursor: pointer;
}

/* Today — teal outline ring */
.fc .fc-day-today {
    background: transparent !important;
}

.fc .fc-day-today .fc-daygrid-day-frame {
    outline: 2px solid var(--sky);
    outline-offset: -2px;
    background: var(--sky-10);
}

.fc .fc-day-today .fc-daygrid-day-number {
    font-weight: 800;
    color: var(--sky);
}

/* Month title — asymmetric card header */
.fc .fc-multimonth-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.625rem 1rem;
    background: var(--oxford);
    color: var(--white);
}

/* Month card — white on card-bg for depth without shadows */
.fc .fc-multimonth-month {
    border: 1px solid var(--border);
    border-radius: 0 20px 0 20px;
    margin-bottom: 1rem;
    overflow: hidden;
    background: var(--white);
    /* White against --card-bg creates depth without any shadow */
}

/* Day number */
.fc .fc-multimonth .fc-daygrid-day-number {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 2px 5px;
    color: var(--text);
}

/* Day-of-week header */
.fc .fc-multimonth .fc-col-header-cell {
    background: var(--oxford-06);
    border-bottom: 2px solid var(--oxford-10) !important;
}

.fc .fc-multimonth .fc-col-header-cell-cushion {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.4rem 0.25rem;
}

/* Compact cell height */
.fc .fc-multimonth .fc-daygrid-day-frame {
    min-height: 2.125rem;
    height: auto;
}

.fc .fc-multimonth .fc-daygrid-body-natural .fc-daygrid-day-events {
    margin-bottom: 0;
}

.fc .fc-multimonth .fc-daygrid-day-top {
    flex-direction: row;
}

/* Event pills */
.fc .fc-multimonth .fc-daygrid-event {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
}

/* Hide "+N more" */
.fc .fc-daygrid-more-link {
    display: none !important;
}

/* Hide disabled placeholder cells (empty trailing weeks in multimonth) */
.fc .fc-day-disabled {
    visibility: hidden;
}

/* Collapse rows where ALL cells are disabled (fully empty weeks) */
.fc .fc-daygrid-body tr:not(:has(.fc-day:not(.fc-day-disabled))) {
    display: none;
}

/* ============================================
   SIDEBAR
   ============================================ */
#date-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1rem;
    position: sticky;
    top: calc(53px + 1.25rem);
    max-height: calc(100vh - 53px - 2.5rem);
    overflow-y: auto;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
}

/* --- Instructions Box --- */
.instructions-box {
    background: var(--oxford-06);
    border-left: 3px solid var(--sky);
    border-radius: 4px;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.875rem;
}

.instructions-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--oxford);
    margin-bottom: 0.375rem;
}

.instructions-steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0 0 0.375rem 0;
}

.instructions-steps li {
    counter-increment: step;
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.instructions-steps li::before {
    content: counter(step) ".";
    font-weight: 700;
    color: var(--sky);
    margin-right: 0.3rem;
}

.instructions-note {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
}

#date-sidebar h3 {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--oxford);
    margin-bottom: 0.875rem;
}

.date-section {
    margin-bottom: 0.875rem;
}

.date-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.5rem;
}

.pending-label { color: var(--sky); }
.submitted-label {
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.lock-badge { font-size: 0.65rem; }

/* Date chips */
.date-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.date-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

.date-item.pending {
    background: var(--sky-15);
    color: var(--sky);
    border: 1px solid rgba(0,130,152,0.25);
}

.date-item.submitted {
    background: var(--green-12);
    color: var(--green);
    border: 1px solid rgba(46,133,64,0.2);
}

.btn-icon {
    width: 16px;
    height: 16px;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: var(--transition);
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
}

.btn-icon:hover { opacity: 1; }

.empty-state {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 1.5rem 0.5rem;
    line-height: 1.7;
    font-weight: 300;
}

/* Pinned submit footer */
.sidebar-actions {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: -1rem;
    padding: 0.75rem 1rem;
    border-radius: 0 0 0 32px;
}

.pending-summary {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 0.5rem;
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8125rem;
    border: none;
}

.btn-text:hover {
    background: var(--oxford-06);
    color: var(--oxford);
}

.submit-success {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    background: var(--green-12);
    color: var(--green);
    border-left: 3px solid var(--green);
}

.submit-error {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    background: var(--error-08);
    color: var(--error);
    border-left: 3px solid var(--error);
}

/* ============================================
   PAST DATE STYLING
   ============================================ */
.fc-day-past {
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================
   HOLIDAY INDICATORS
   ============================================ */
.holiday-pill {
    display: block;
    background: #470A68;
    color: var(--white);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 0.5rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    pointer-events: none;
    margin-top: 1px;
}

/* ============================================
   HEATMAP TOOLTIPS
   ============================================ */
.heatmap-info-container {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 5;
}

.heatmap-info {
    font-size: 0.65rem;
    cursor: pointer;
    opacity: 0.4;
    transition: var(--transition);
}

.heatmap-info:hover { opacity: 1; }

.heatmap-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--oxford);
    color: var(--white);
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    z-index: 100;
    pointer-events: none;
}

.heatmap-tooltip.visible { display: block; }

.fc-daygrid-day-frame { position: relative; }

/* ============================================
   BUTTONS — Duly squared ghost style
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-btn);
    font-size: 0.875rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

/* Primary — solid oxford, sky hover (ghost feel via color shift) */
.btn-primary {
    background: transparent;
    color: var(--oxford);
    border: 2px solid var(--oxford);
}

.btn-primary:hover {
    background: var(--sky-10);
    border-color: var(--sky);
    color: var(--sky);
}

.btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-danger {
    background: transparent;
    color: var(--error);
    padding: 0.2rem 0.4rem;
    border: none;
    border-radius: var(--radius-btn);
}

.btn-danger:hover { background: var(--error-08); }

/* ============================================
   FORMS
   ============================================ */
input,
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font);
    background: var(--white);
    color: var(--text);
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px var(--sky-15);
}

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

/* Dr. prefix select group */
.select-with-prefix {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    overflow: hidden;
    transition: var(--transition);
}

.select-with-prefix:focus-within {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px var(--sky-15);
}

.select-prefix {
    padding: 0.625rem 0 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--oxford);
    white-space: nowrap;
    font-family: var(--font);
    user-select: none;
}

.select-with-prefix select {
    border: none;
    box-shadow: none;
    background: transparent;
    padding-left: 0.25rem;
    border-radius: 0;
}

.select-with-prefix select:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    header {
        padding: 0.75rem 1rem;
    }

    header h1 {
        font-size: 0.875rem;
    }

    .header-left,
    .header-right { width: auto; }

    main {
        flex-direction: column;
        padding: 0.75rem;
    }

    #date-sidebar {
        width: 100%;
        max-height: none;
        position: static;
        border-radius: var(--radius-card);
    }

    #calendar-container {
        padding: 0.75rem;
    }

    .fc .fc-col-header-cell-cushion {
        font-size: 0.6rem;
    }

    .fc .fc-daygrid-day-number {
        font-size: 0.72rem;
        padding: 2px;
    }

    .heatmap-tooltip {
        white-space: normal;
        max-width: 140px;
    }

    .calendar-nav-title {
        font-size: 1.4rem;
    }
}
