/* =====================================================================
   GoFare — Centrav-style Date Picker (UI-only)
   - Styles for:
     1) .gf-date-ui (the visible replacement for <input type="date">)
     2) .gf-cal-pop overlay calendar
   ===================================================================== */

/* Visible replacement for the native date input */
.gf-date-ui {
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 18px 18px;
    padding-right: 2.5rem; /* room for icon */

    /* Inline SVG calendar icon (stroke: slate-ish) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235B6472' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

/* Keep icon readable on valid background */
.gf-date-ui.bg-sky-50 {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230B3A78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.gf-date-ui:disabled {
    cursor: not-allowed;
}

/* Overlay container */
.gf-cal-pop {
    position: absolute;
    z-index: 9999;
    background: #ffffff;
    /* Centrav-like: crisp border + modest shadow + squarer corners */
    border: 1px solid #d1d5db; /* gray-300 */
    /* Centrav reference is very square; keep only a hint of rounding */
    border-radius: 3px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.gf-cal-shell {
    width: 100%;
}

.gf-cal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 10px;
}

.gf-cal-top--single {
    justify-content: flex-start;
}

.gf-cal-sel {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

.gf-cal-daynum {
    font-size: 46px;
    line-height: 1;
    font-weight: 700;
    color: #dc2626; /* red-600 */
    letter-spacing: -0.02em;
}

.gf-cal-daynum--empty {
    color: #cbd5e1; /* slate-300 */
}

.gf-cal-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gf-cal-meta-1 {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a; /* slate-900 */
}

.gf-cal-meta-2 {
    font-size: 12px;
    color: #475569; /* slate-600 */
}

.gf-cal-arrow {
    flex: 0 0 auto;
    font-size: 28px;
    color: #0f172a;
    margin: 0 4px;
}

.gf-cal-body {
    border-top: 1px solid #e5e7eb; /* gray-200 */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
}

/* Thin divider between months (Centrav reference) */
.gf-cal-body .gf-cal-month:nth-child(2) {
    border-left: 1px solid #e5e7eb;
}

@media (max-width: 640px) {
    .gf-cal-body {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .gf-cal-body .gf-cal-month:nth-child(2) {
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
    .gf-cal-top {
        flex-direction: column;
        align-items: stretch;
    }
    .gf-cal-arrow {
        display: none;
    }
    .gf-cal-sel {
        min-width: 0;
    }
}

.gf-cal-month {
    padding: 10px 12px 12px;
}

.gf-cal-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.gf-cal-month-title {
    flex: 1 1 auto;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #374151; /* gray-700 */
}

.gf-cal-nav,
.gf-cal-nav-spacer {
    width: 36px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gf-cal-nav {
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    color: #111827; /* gray-900 */
}

.gf-cal-nav:hover {
    background: #f3f4f6; /* gray-100 */
}

.gf-cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280; /* gray-500 */
    text-align: center;
}

.gf-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* Centrav shows tight, contiguous selection blocks */
    gap: 0;
}

.gf-cal-day {
    height: 30px;
    border-radius: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #111827;
}

.gf-cal-day:hover {
    background: #f3f4f6;
}

.gf-cal-day:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.gf-cal-day.other {
    color: #94a3b8; /* slate-400 */
}

/* "Today" indicator (matches Centrav red date) */
.gf-cal-day.today:not(.start):not(.end):not(.inrange):not(.selected) {
    color: #dc2626;
    font-weight: 700;
}

/* Selection styling (Centrav-like) */
.gf-cal-day.inrange {
    background: #0a3372; /* Centrav-ish navy */
    color: #ffffff;
}

.gf-cal-day.start,
.gf-cal-day.end,
.gf-cal-day.selected {
    background: #0a3372;
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

/* Slightly emphasize endpoints */
.gf-cal-day.start,
.gf-cal-day.end {
    background: #062a5c;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

/* Keyboard focus (accessibility) */
.gf-cal-day:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.8); /* sky-ish */
    outline-offset: -2px;
}
