/*
 * BookingCalendarWidget's styling — the occupancy heat-map month grid
 * (rewritten 2026-08-30, replacing the FullCalendar overrides that came
 * before it).
 *
 * Registered via FilamentAsset (not the Vite bundle) because the Company
 * panel serves Filament's precompiled theme: neither panel registers a
 * ->viteTheme(), so resources/css/app.css never reaches these pages.
 * That means every rule here has to be real CSS — no Tailwind
 * utilities, no @apply. Colors are written twice (light, then a
 * `.dark`-prefixed override) rather than as variables behind a media
 * query, because Filament drives dark mode with a `.dark` class on
 * <html> and not with prefers-color-scheme. Directional properties are
 * all logical (inline-start/end) so the grid stays correct under the
 * Arabic RTL locale.
 */

/* ---------------------------------------------------------------------
 * Header — month navigation alongside the New Reservation button
 * ------------------------------------------------------------------ */

.bkc-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bkc-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bkc-month {
    min-width: 9rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    border-radius: 0.5rem;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.bkc-month:hover {
    background: rgba(17, 24, 39, 0.05);
}

.dark .bkc-month {
    color: #e5e7eb;
}

.dark .bkc-month:hover {
    background: rgba(255, 255, 255, 0.07);
}

/* ---------------------------------------------------------------------
 * Grid
 * ------------------------------------------------------------------ */

.bkc-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.375rem;
}

.bkc-weekday {
    padding: 0.375rem 0;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #6b7280;
}

.dark .bkc-weekday {
    color: #9ca3af;
}

.bkc-day {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 5.25rem;
    padding: 0.5rem;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 0.625rem;
    text-align: start;
    font: inherit;
    color: inherit;
}

.dark .bkc-day {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Open days are <button>s (clicking one opens the pre-filled create
   modal); closed and padding days are inert <div>s. */
.bkc-day-open {
    cursor: pointer;
    width: 100%;
}

.bkc-day-open:hover {
    border-color: rgb(var(--primary-500));
}

.bkc-day-open:focus-visible {
    outline: 2px solid rgb(var(--primary-500));
    outline-offset: 1px;
}

.bkc-day-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    font-variant-numeric: tabular-nums;
}

.dark .bkc-day-number {
    color: #e5e7eb;
}

.bkc-percentage {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.bkc-quantity {
    font-size: 0.68rem;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.dark .bkc-quantity {
    color: #9ca3af;
}

.bkc-closed-label {
    margin-top: auto;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
}

.dark .bkc-closed-label {
    color: #9ca3af;
}

.bkc-bar {
    height: 0.3rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.08);
    overflow: hidden;
}

.dark .bkc-bar {
    background: rgba(255, 255, 255, 0.12);
}

/* currentColor: the fill inherits whichever heat band's text color the
   cell carries, so the bar can never disagree with the percentage. */
.bkc-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: currentColor;
}

.bkc-padding {
    border-style: dashed;
    opacity: 0.35;
}

.bkc-today {
    outline: 2px solid rgb(var(--primary-500));
    outline-offset: 1px;
}

.bkc-past {
    opacity: 0.6;
}

/* ---------------------------------------------------------------------
 * Heat bands
 * ------------------------------------------------------------------ */

.bkc-heat-empty {
    background: rgba(17, 24, 39, 0.02);
}

.dark .bkc-heat-empty {
    background: rgba(255, 255, 255, 0.02);
}

.bkc-heat-low {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.dark .bkc-heat-low {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
}

.bkc-heat-40 {
    background: rgba(234, 179, 8, 0.12);
    color: #a16207;
}

.dark .bkc-heat-40 {
    background: rgba(234, 179, 8, 0.18);
    color: #fde047;
}

.bkc-heat-70 {
    background: rgba(249, 115, 22, 0.14);
    color: #c2410c;
}

.dark .bkc-heat-70 {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
}

.bkc-heat-90 {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.dark .bkc-heat-90 {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.bkc-heat-full {
    background: rgba(239, 68, 68, 0.22);
    color: #991b1b;
}

.dark .bkc-heat-full {
    background: rgba(239, 68, 68, 0.3);
    color: #fecaca;
}

.bkc-closed {
    background: repeating-linear-gradient(45deg, rgba(17, 24, 39, 0.03) 0 6px, transparent 6px 12px);
}

.dark .bkc-closed {
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 6px, transparent 6px 12px);
}

/* ---------------------------------------------------------------------
 * Legend
 * ------------------------------------------------------------------ */

.bkc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: 0.7rem;
    color: #6b7280;
}

.dark .bkc-legend {
    color: #9ca3af;
}

.bkc-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.bkc-swatch {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.dark .bkc-swatch {
    border-color: rgba(255, 255, 255, 0.1);
}
