/* ============================================================
   booking-calendar.css — Calendar + slot picker for /booking
   ============================================================ */

/* ---- Config picker (3-way + geography) ---- */
.config-picker {
    max-width: 900px;
    margin: 0 auto var(--space-10);
}
.config-picker-label {
    font-weight: 600;
    margin-bottom: var(--space-4);
    text-align: center;
}
.config-picker-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.config-tile {
    cursor: pointer;
    position: relative;
    display: block;
}
.config-tile input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.config-tile-body {
    border: 2px solid var(--border);
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    transition: all var(--transition);
    height: 100%;
}
.config-tile-body strong {
    display: block;
    margin-bottom: 6px;
    font-size: var(--text-base);
}
.config-tile-body p {
    font-size: var(--text-sm);
    color: var(--mid);
    margin: 0;
    line-height: 1.4;
}
.config-tile input[type="radio"]:checked + .config-tile-body {
    border-color: var(--orange);
    background: var(--orange-light);
    box-shadow: 0 4px 12px rgba(255, 104, 0, 0.12);
}

/* ---- Geo locator (autocomplete + map + zone routing) ---- */
.geo-locator {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    max-width: 900px;
    margin: 0 auto;
}
.geo-locator > * {
    margin-left: 0;
    margin-right: 0;
}
.geo-locator-label {
    display: block;
    font-weight: 600;
    font-size: var(--text-base);
    margin-bottom: var(--space-4);
}
.geo-input-wrap {
    position: relative;
}
.geo-input {
    width: 100%;
}
.geo-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    display: none;
}
.geo-suggestion {
    padding: 10px 14px;
    font-size: var(--text-sm);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}
.geo-suggestion:last-child { border-bottom: none; }
.geo-suggestion:hover { background: rgba(255, 104, 0, 0.08); }
.geo-zone-chip {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    line-height: 1.45;
}
.geo-zone-chip strong { display: block; margin-bottom: 2px; }
.geo-zone-good { background: rgba(74,222,128,0.14); border-left: 3px solid #4ade80; color: #14532d; }
.geo-zone-info { background: rgba(96,165,250,0.14); border-left: 3px solid #60a5fa; color: #1e3a8a; }
.geo-zone-warn { background: rgba(251,191,36,0.16); border-left: 3px solid #fbbf24; color: #78350f; }
.geo-travel-range {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    line-height: 1.5;
}
.geo-range-muted {
    display: block;
    color: var(--mid);
    font-size: var(--text-xs);
    margin-top: 4px;
}
.geo-pivot-prompt {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(251,191,36,0.16);
    border-left: 3px solid #f59e0b;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: #78350f;
}
.geo-map {
    margin-top: var(--space-3);
    height: 220px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
    z-index: 0;
    isolation: isolate;
}
/* Trap Leaflet's internal z-indexes (default up to 1000) below the nav (z-index 100). */
.geo-map .leaflet-pane,
.geo-map .leaflet-top,
.geo-map .leaflet-bottom,
.geo-map .leaflet-control { z-index: 1 !important; }
.geo-map .leaflet-tile-pane { z-index: 1 !important; }
.geo-map .leaflet-overlay-pane { z-index: 2 !important; }
.geo-map .leaflet-marker-pane { z-index: 3 !important; }
.geo-map .leaflet-tooltip-pane { z-index: 4 !important; }
.geo-map .leaflet-popup-pane { z-index: 5 !important; }
.geo-hint {
    margin-top: var(--space-4);
    margin-bottom: 0;
    font-size: var(--text-xs);
    color: var(--mid);
    line-height: 1.5;
}

/* ---- Calendar wrapper ---- */
#booking-calendar {
    max-width: 100%;
    margin-top: var(--space-3);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    font-size: var(--text-sm);
    color: var(--mid);
    margin-bottom: var(--space-4);
    align-items: center;
}
.cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.cal-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
}
.cal-dot-green  { background: #4ade80; }
.cal-dot-yellow { background: #fbbf24; }
.cal-dot-red    { background: #dc2626; }

/* ---- Day color overrides on FullCalendar grid ---- */
.fc-daygrid-day.cal-status-green {
    background-color: rgba(74, 222, 128, 0.10);
    cursor: pointer;
}
.fc-daygrid-day.cal-status-green:hover { background-color: rgba(74, 222, 128, 0.22); }
.fc-daygrid-day.cal-status-yellow {
    background-color: rgba(251, 191, 36, 0.14);
    cursor: pointer;
}
.fc-daygrid-day.cal-status-yellow:hover { background-color: rgba(251, 191, 36, 0.28); }
.fc-daygrid-day.cal-status-red {
    background-color: rgba(220, 38, 38, 0.08);
    cursor: not-allowed;
}
.fc-daygrid-day.cal-status-unavailable {
    background-color: rgba(0, 0, 0, 0.03);
    cursor: not-allowed;
}
.fc-daygrid-day.cal-day-selected {
    outline: 3px solid var(--orange);
    outline-offset: -3px;
}

.fc .fc-button-primary {
    background-color: var(--dark) !important;
    border-color: var(--dark) !important;
}
.fc .fc-button-primary:hover {
    background-color: var(--orange) !important;
    border-color: var(--orange) !important;
}
.fc .fc-toolbar-title {
    font-size: var(--text-lg);
    font-weight: 700;
}

/* ---- Slot grid (start-time + duration) ---- */
.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-3);
}
.slot-btn {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
    transition: all var(--transition);
    text-align: center;
    position: relative;
}
.slot-btn:hover {
    border-color: var(--orange);
    transform: translateY(-1px);
}
.slot-btn.is-selected {
    background: var(--orange);
    border-color: var(--orange);
    color: var(--white);
}
.slot-btn.is-yellow {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
}
.slot-btn.is-yellow.is-selected {
    background: #fbbf24;
    color: var(--dark);
}
.slot-btn.is-yellow::after {
    content: '★';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    color: #d97706;
}
.slot-btn.is-disabled {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.35);
    cursor: not-allowed;
    pointer-events: none;
}

.duration-hint {
    font-size: var(--text-xs);
    color: var(--mid);
    margin-top: var(--space-3);
    font-style: italic;
}

.yellow-callout {
    background: rgba(251, 191, 36, 0.12);
    border-left: 3px solid #fbbf24;
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    margin-top: var(--space-3);
    color: #92400e;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .slot-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .config-picker-row { grid-template-columns: 1fr; }
    .cal-legend { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
    .cal-legend-item { white-space: normal; }
}
