/**
 * Modern Court Calendar Styles
 */

/* Calendar Container */
.court-calendar-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Court Toggle Buttons */
.court-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.court-toggle-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: #ffffff;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.court-toggle-btn:hover {
    border-color: #1e73be;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.court-toggle-btn.active {
    background: linear-gradient(135deg, #1e73be 0%, #0e5a8f 100%);
    color: #ffffff;
    border-color: #1e73be;
    box-shadow: 0 4px 12px rgba(30, 115, 190, 0.3);
}

.court-toggle-btn.court-yellow.active {
    background: linear-gradient(135deg, #efe821 0%, #d4d01e 100%);
    color: #0a0a0a;
    border-color: #efe821;
    box-shadow: 0 4px 12px rgba(239, 232, 33, 0.3);
}

.court-toggle-btn.court-blue.active {
    background: linear-gradient(135deg, #1e73be 0%, #0e5a8f 100%);
    color: #ffffff;
    border-color: #1e73be;
    box-shadow: 0 4px 12px rgba(30, 115, 190, 0.3);
}

/* Calendar Element */
#court-calendar {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Loader / Skeleton */
#calendar-loader {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 16px;
}

#calendar-loader.hidden {
    display: none;
}

/* Skeleton shimmer */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.cal-skel-block,
.cal-skel-dayhead,
.cal-skel-slot {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 4px;
}

.cal-skel {
    padding: 16px;
}

.cal-skel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
}

.cal-skel-cols {
    display: flex;
    gap: 2px;
}

.cal-skel-timecol {
    width: 48px;
    flex-shrink: 0;
    padding-top: 36px;
}

.cal-skel-time {
    height: 40px;
    font-size: 11px;
    color: #ccc;
    text-align: right;
    padding-right: 8px;
    line-height: 40px;
}

.cal-skel-daycol {
    flex: 1;
}

.cal-skel-dayhead {
    height: 36px;
    margin-bottom: 2px;
}

.cal-skel-slot {
    height: 40px;
    margin-bottom: 2px;
    border-radius: 2px;
}

/* Stagger shimmer per column */
.cal-skel-daycol:nth-child(2) .cal-skel-block,
.cal-skel-daycol:nth-child(2) .cal-skel-dayhead,
.cal-skel-daycol:nth-child(2) .cal-skel-slot { animation-delay: 0.1s; }
.cal-skel-daycol:nth-child(3) .cal-skel-dayhead,
.cal-skel-daycol:nth-child(3) .cal-skel-slot { animation-delay: 0.2s; }
.cal-skel-daycol:nth-child(4) .cal-skel-dayhead,
.cal-skel-daycol:nth-child(4) .cal-skel-slot { animation-delay: 0.3s; }
.cal-skel-daycol:nth-child(5) .cal-skel-dayhead,
.cal-skel-daycol:nth-child(5) .cal-skel-slot { animation-delay: 0.4s; }
.cal-skel-daycol:nth-child(6) .cal-skel-dayhead,
.cal-skel-daycol:nth-child(6) .cal-skel-slot { animation-delay: 0.5s; }
.cal-skel-daycol:nth-child(7) .cal-skel-dayhead,
.cal-skel-daycol:nth-child(7) .cal-skel-slot { animation-delay: 0.6s; }
.cal-skel-daycol:nth-child(8) .cal-skel-dayhead,
.cal-skel-daycol:nth-child(8) .cal-skel-slot { animation-delay: 0.7s; }

/* FullCalendar Customizations */
.fc {
    font-family: inherit;
}

.fc .fc-toolbar-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #1a1a1a;
}

.fc .fc-button {
    padding: 8px 16px;
    font-weight: 600;
    border-radius: 6px;
    text-transform: capitalize;
    transition: all 0.2s ease;
}

.fc .fc-button-primary {
    background-color: #1e73be;
    border-color: #1e73be;
}

.fc .fc-button-primary:hover {
    background-color: #0e5a8f;
    border-color: #0e5a8f;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: #0e5a8f;
    border-color: #0e5a8f;
    box-shadow: 0 2px 8px rgba(30, 115, 190, 0.3);
}

.fc .fc-col-header-cell {
    background-color: #f8f9fa;
    font-weight: 600;
    padding: 12px 4px;
}

.fc .fc-timegrid-slot {
    height: 3em;
}

.fc .fc-timegrid-slot-label {
    font-weight: 500;
    color: #666;
}

.fc .fc-event {
    border-radius: 4px;
    padding: 4px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fc .fc-event:hover {
    opacity: 0.85;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fc .fc-event-title {
    font-weight: 600;
}

.fc .fc-event-time {
    font-weight: 500;
    opacity: 0.9;
}

/* Resource columns */
.fc .fc-resource-timeline-divider {
    width: 2px;
    background-color: #e0e0e0;
}

.fc .fc-timeline-slot {
    border-color: #e8e8e8;
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: #e8e8e8;
}

.fc .fc-scrollgrid {
    border-color: #e0e0e0;
}

.fc .fc-daygrid-week-number {
    font-size: 11px;
    color: #aaa;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.fc .fc-daygrid-week-number:hover {
    background: #f0f4ff;
    color: #1e73be;
}

.fc .fc-daygrid-day-number {
    transition: all 0.15s ease;
    border-radius: 4px;
    padding: 4px 6px;
}

.fc .fc-daygrid-day-number:hover {
    background: #f0f4ff;
    color: #1e73be;
}

.fc .fc-col-header-cell-cushion {
    transition: color 0.15s ease;
}

.fc .fc-col-header-cell-cushion:hover {
    color: #1e73be;
}

/* Today highlight */
.fc .fc-day-today {
    background-color: rgba(30, 115, 190, 0.05) !important;
}

.fc .fc-timegrid-col.fc-day-today {
    background-color: rgba(30, 115, 190, 0.03);
}

/* Now indicator */
.fc .fc-timegrid-now-indicator-line {
    border-color: #e74c3c;
    border-width: 2px;
}

.fc .fc-timegrid-now-indicator-arrow {
    border-color: #e74c3c;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .court-calendar-wrapper {
        padding: 12px;
    }

    .court-toggle {
        gap: 8px;
        margin-bottom: 16px;
    }

    .court-toggle-btn {
        padding: 10px 16px;
        font-size: 14px;
        flex: 1;
        min-width: calc(50% - 4px);
    }

    .fc .fc-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .fc .fc-toolbar-title {
        font-size: 1.2em;
    }

    .fc .fc-button {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .fc .fc-event {
        font-size: 0.8em;
    }

    #court-calendar {
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .court-toggle-btn {
        min-width: 100%;
    }

    .fc .fc-toolbar-chunk {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

/* Error message */
.calendar-error {
    padding: 40px 20px;
    text-align: center;
    color: #e74c3c;
    font-weight: 600;
    background: #ffebee;
    border-radius: 8px;
    margin: 20px 0;
}

/* Loading state */
.court-calendar-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Past events — faded */
.fc .fc-event.fc-event-past {
    opacity: 0.4;
    filter: grayscale(40%);
}

.fc .fc-event.fc-event-past:hover {
    opacity: 0.6;
    filter: grayscale(20%);
}

/* Toggle fade transition */
#court-calendar {
    transition: opacity 0.25s ease;
}

#court-calendar.calendar-transitioning {
    opacity: 0.3;
}

/* Event tooltip */
#court-calendar-tooltip {
    position: absolute;
    z-index: 9999;
    width: 220px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    pointer-events: none;
    animation: ct-fade-in 0.15s ease;
}

#court-calendar-tooltip.hidden {
    display: none;
}

@keyframes ct-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ct-bar {
    height: 5px;
    width: 100%;
}

.ct-body {
    padding: 12px 14px;
}

.ct-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.ct-time {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.ct-desc {
    margin-top: 8px;
    font-size: 12px;
    color: #777;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
    line-height: 1.5;
}
