:root {
    color-scheme: light;
    --cdm-shell-bg: #f8fafc;
    --cdm-shell-panel: rgba(255, 255, 255, 0.88);
    --cdm-shell-border: rgba(148, 163, 184, 0.18);
    --cdm-shell-accent: rgba(15, 23, 42, 0.06);
}

html.dark {
    color-scheme: dark;
    --cdm-shell-bg: #0f172a;
    --cdm-shell-panel: rgba(30, 41, 59, 0.84);
    --cdm-shell-border: rgba(71, 85, 105, 0.7);
    --cdm-shell-accent: rgba(148, 163, 184, 0.07);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--cdm-shell-bg);
}

.cdm-shell {
    position: relative;
    isolation: isolate;
}

.cdm-public-shell {
    position: relative;
    isolation: isolate;
}

.cdm-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at top left, rgba(226, 232, 240, 0.5), transparent 28%),
        radial-gradient(circle at top right, rgba(226, 232, 240, 0.3), transparent 24%);
    pointer-events: none;
}

.cdm-public-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at top center, rgba(226, 232, 240, 0.8), transparent 38%),
        radial-gradient(circle at bottom left, rgba(241, 245, 249, 0.7), transparent 28%);
    pointer-events: none;
}

html.dark .cdm-shell::before {
    background:
        radial-gradient(circle at top left, rgba(71, 85, 105, 0.22), transparent 26%),
        radial-gradient(circle at top right, rgba(30, 41, 59, 0.55), transparent 28%);
}

html.dark .cdm-public-shell::before {
    background:
        radial-gradient(circle at top center, rgba(51, 65, 85, 0.34), transparent 34%),
        radial-gradient(circle at bottom left, rgba(15, 23, 42, 0.82), transparent 30%);
}

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

[data-shell-root][data-sidebar-open="true"] [data-sidebar-backdrop] {
    opacity: 1;
    visibility: visible;
}

[data-shell-root][data-sidebar-open="true"] [data-sidebar-panel] {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    [data-sidebar-backdrop] {
        display: none !important;
    }
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.45);
    background-clip: padding-box;
}

html.dark ::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.65);
    background-clip: padding-box;
}

.fc {
    --fc-border-color: rgba(148, 163, 184, 0.22);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: rgba(248, 250, 252, 0.9);
    --fc-list-event-hover-bg-color: rgba(241, 245, 249, 0.9);
    --fc-button-bg-color: #0f172a;
    --fc-button-border-color: #0f172a;
    --fc-button-hover-bg-color: #1e293b;
    --fc-button-hover-border-color: #1e293b;
    --fc-button-active-bg-color: #334155;
    --fc-button-active-border-color: #334155;
    --fc-event-border-color: transparent;
    --fc-event-text-color: #ffffff;
    --fc-today-bg-color: rgba(99, 102, 241, 0.06);
    --fc-now-indicator-color: #6366f1;
}

html.dark .fc {
    --fc-border-color: rgba(71, 85, 105, 0.6);
    --fc-neutral-bg-color: rgba(30, 41, 59, 0.78);
    --fc-list-event-hover-bg-color: rgba(30, 41, 59, 0.85);
    --fc-button-bg-color: #e2e8f0;
    --fc-button-border-color: #e2e8f0;
    --fc-button-hover-bg-color: #f8fafc;
    --fc-button-hover-border-color: #f8fafc;
    --fc-button-active-bg-color: #cbd5e1;
    --fc-button-active-border-color: #cbd5e1;
    --fc-button-text-color: #0f172a;
    --fc-today-bg-color: rgba(99, 102, 241, 0.07);
    --fc-now-indicator-color: #818cf8;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.fc .fc-toolbar-title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
}

html.dark .fc .fc-toolbar-title {
    color: #f8fafc;
}

.fc .fc-button {
    box-shadow: none;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: none;
    padding: 0.375rem 0.875rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.fc .fc-button-group .fc-button {
    border-radius: 0;
}

.fc .fc-button-group .fc-button:first-child {
    border-radius: 0.75rem 0 0 0.75rem;
}

.fc .fc-button-group .fc-button:last-child {
    border-radius: 0 0.75rem 0.75rem 0;
}

/* ── Grid borders ────────────────────────────────────────────────────────── */
.fc .fc-scrollgrid,
.fc .fc-theme-standard td,
.fc .fc-theme-standard th {
    border-color: var(--fc-border-color);
}

/* ── Column headers ──────────────────────────────────────────────────────── */
.fc .fc-col-header-cell-cushion {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.5rem 0.25rem;
}

html.dark .fc .fc-col-header-cell-cushion {
    color: #94a3b8;
}

/* ── Day number ──────────────────────────────────────────────────────────── */
.fc .fc-daygrid-day-number {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    padding: 0.375rem 0.5rem;
}

html.dark .fc .fc-daygrid-day-number {
    color: #94a3b8;
}

.fc .fc-day-today .fc-daygrid-day-number {
    background: #6366f1;
    color: #ffffff;
    border-radius: 9999px;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.25rem;
    padding: 0;
    font-weight: 700;
}

/* ── List view ───────────────────────────────────────────────────────────── */
.fc .fc-list-day-text,
.fc .fc-list-day-side-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

html.dark .fc .fc-list-day-text,
html.dark .fc .fc-list-day-side-text {
    color: #94a3b8;
}

.fc .fc-list-event:hover td {
    background: rgba(241, 245, 249, 0.8);
}

html.dark .fc .fc-list-event:hover td {
    background: rgba(30, 41, 59, 0.85);
}

/* ── Time slot labels ────────────────────────────────────────────────────── */
.fc .fc-timegrid-slot-label-cushion {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #94a3b8;
}

/* ── Now indicator ───────────────────────────────────────────────────────── */
.fc .fc-timegrid-now-indicator-line {
    border-color: var(--fc-now-indicator-color);
    border-width: 2px;
}

.fc .fc-timegrid-now-indicator-arrow {
    border-color: var(--fc-now-indicator-color);
}

/* ── Events ──────────────────────────────────────────────────────────────── */
.fc .fc-event {
    border-radius: 0.625rem;
    box-shadow: none;
    cursor: pointer;
}

.fc .fc-daygrid-event {
    border-radius: 0.5rem;
    padding: 0.1rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.fc .fc-timegrid-event {
    border-radius: 0.625rem;
    padding: 0.25rem 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.fc .fc-event-title {
    font-size: 0.75rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc .fc-timegrid-event .fc-event-title {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fc .fc-event-time {
    font-size: 0.6875rem;
    font-weight: 500;
    opacity: 0.85;
}

/* ── "More" link ─────────────────────────────────────────────────────────── */
.fc .fc-daygrid-more-link {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #6366f1;
}

html.dark .fc .fc-daygrid-more-link {
    color: #818cf8;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
