:root {
    --smith-blue: #071d49;
    --smith-rose: var(--rose);
    --smith-tangerine: var(--tangerine-300);
    --toronto-color: var(--sky);
    --kingston-color: var(--rose);
    --virtual-color: var(--purple);
    --other-color: #4b5563;
    --card-border: rgba(0, 0, 0, 0.08);
}

/* Premium Header Card */
.calendar-header-card {
    background: linear-gradient(135deg, var(--smith-blue) 0%, #08162b 100%);
    color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(17, 44, 85, 0.15);
    border: none;
    overflow: hidden;
    position: relative;
}

.calendar-header-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(241, 184, 45, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* Filter Controls */
.filter-section {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--card-border);
}

.filter-label {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.5rem;
}

/* Custom Scrollbar for Checkboxes */
.category-scroll-container {
    overflow-y: auto;
    padding-right: 5px;
}

.category-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.category-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.category-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.category-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* View Toggle Tabs */
.view-btn-group .btn {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border: 1px solid #cbd5e1;
}

.view-btn-group .btn-check:checked + .btn {
    background-color: var(--smith-blue);
    border-color: var(--smith-blue);
    color: #ffffff;
    text-decoration: none;
}

/* Physical Calendar Grid Styling */
.calendar-container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.calendar-nav {
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-nav h2 {
    font-weight: 700;
    color: var(--smith-blue);
    margin: 0;
    font-size: 1.5rem;
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background-color: #f8fafc;
    border-bottom: 1px solid var(--card-border);
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: #64748b;
    padding: 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: 28px;
    grid-auto-rows: 30px;
    border-bottom: 1px solid var(--card-border);
    position: relative;
    align-content: start;
    min-height: 120px;
}

.calendar-week:last-child {
    border-bottom: none;
}

/* Background Container for Grid lines */
.calendar-day-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    z-index: 1;
    pointer-events: none;
}

/* Day Cells */
.day-cell {
    border-right: 1px solid var(--card-border);
    padding: 4px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    transition: background-color 0.2s ease;
    height: 100%;
    pointer-events: auto;
}

.day-cell:last-child {
    border-right: none;
}

.day-cell.other-month {
    background-color: #f8fafc;
    color: #cbd5e1;
}

.day-cell:hover:not(.other-month) {
    background-color: #f1f5f9;
}

.day-number-container {
    display: flex;
    justify-content: flex-end;
    z-index: 1;
}

.day-number {
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.day-cell.today .day-number {
    background-color: var(--azure);
    color: #ffffff !important;
}

.day-cell.selected-day-mobile {
    background-color: #eff6ff !important;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

/* Event Spanning Bars (Desktop) */
.event-bar {
    z-index: 2;
    position: relative;
    margin: 2px 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.event-bar:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* Color Coding Rules */
.bg-loc-kingston {
    background-color: var(--kingston-color) !important;
}
.bg-loc-toronto {
    background-color: var(--toronto-color) !important;
}
.bg-loc-virtual {
    background-color: var(--virtual-color) !important;
}
.bg-loc-other {
    background-color: var(--other-color) !important;
}

/* Continuation clip paths for spanning arrows */
.event-continues-left {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    margin-left: 0 !important;
    clip-path: polygon(6px 0%, 100% 0%, 100% 100%, 6px 100%, 0% 50%);
    padding-left: 10px !important;
}

.event-continues-right {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin-right: 0 !important;
    clip-path: polygon(0% 0%, calc(100% - 6px) 0%, 100% 50%, calc(100% - 6px) 100%, 0% 100%);
    padding-right: 10px !important;
}

.event-continues-left.event-continues-right {
    clip-path: polygon(6px 0%, calc(100% - 6px) 0%, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0% 50%) !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

/* Mobile Event Dots container */
.mobile-dots-container {
    display: none;
    justify-content: center;
    gap: 3px;
    margin-top: auto;
    padding-bottom: 2px;
    z-index: 2;
}

.mobile-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* Custom Hover Tooltip styling */
#calendar-tooltip {
    position: absolute;
    background-color: #1e293b;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    z-index: 1000;
    display: none;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    max-width: 280px;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#calendar-tooltip h5 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--smith-tangerine);
}

#calendar-tooltip p {
    margin: 0;
}

/* Mobile Date Details Drawer */
.mobile-details-drawer {
    display: none;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--card-border);
    margin-top: 1rem;
    padding: 1rem;
}

/* Schedule (Timeline) View */
.schedule-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.schedule-month-group {
    border-radius: 12px;
    overflow: hidden;
}

.schedule-month-header {
    background-color: var(--smith-blue);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-month-badge {
    background-color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}

.schedule-list {
    background-color: #ffffff;
    border: 1px solid var(--card-border);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 0.5rem 0;
}

.schedule-item {
    padding: 1.25rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-item:hover {
    background-color: #f8fafc;
}

.schedule-item-left {
    display: flex;
    gap: 1.25rem;
    flex: 1;
}

/* Large visual date block on the left */
.schedule-date-badge {
    min-width: 75px;
    height: 75px;
    background-color: #f1f5f9;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-inter);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.schedule-date-month {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
}

.schedule-date-day {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--smith-blue);
    line-height: 1.1;
}

.schedule-date-year {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.schedule-item-content {
    flex: 1;
}

.schedule-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--smith-blue);
    text-decoration: none;
    margin-bottom: 0.4rem;
    display: inline-block;
    transition: color 0.15s ease;
}

.schedule-item-title:hover {
    color: var(--smith-rose);
}

.schedule-meta-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Color badges */
.badge-kingston {
    background-color: rgba(185, 14, 49, 0.1);
    color: var(--kingston-color);
}

.badge-toronto {
    background-color: rgba(17, 44, 85, 0.1);
    color: var(--smith-blue);
}

.badge-virtual {
    background-color: rgba(124, 58, 237, 0.1);
    color: var(--virtual-color);
}

.badge-other {
    background-color: rgba(75, 85, 99, 0.1);
    color: var(--other-color);
}

.schedule-item-right {
    text-align: right;
    margin-left: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 130px;
}

.schedule-price {
    font-weight: 700;
    color: #334155;
    font-size: 1.1rem;
}

.schedule-duration {
    font-size: 0.8rem;
    color: #64748b;
}

/* Mobile Responsiveness Rules */
@media (max-width: 767.98px) {
    .calendar-nav {
        display: grid !important;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        row-gap: 0.75rem;
        column-gap: 0.5rem;
        align-items: center;
        padding: 0.75rem 1rem;
    }
    .calendar-nav-controls {
        grid-column: 1 / span 2;
        grid-row: 2;
        display: flex;
        width: 100%;
        gap: 0.5rem !important;
    }
    .calendar-nav-controls .btn {
        flex: 1;
        padding: 0.375rem 0.75rem;
    }
    .calendar-nav h2 {
        grid-column: 1;
        grid-row: 1;
        font-size: 1.25rem !important;
        text-align: left;
        white-space: nowrap;
        margin: 0;
    }
    .calendar-nav #cal-results-count {
        grid-column: 2;
        grid-row: 1;
        text-align: right;
        white-space: nowrap;
    }
    .view-btn-group {
        width: 100%;
        display: flex;
    }
    .view-btn-group .btn {
        flex: 1;
    }

    .calendar-grid-header {
        font-size: 0.7rem;
        padding: 0.5rem 0;
    }

    .calendar-week {
        grid-template-rows: 20px;
        grid-auto-rows: 0px; /* Hide text event rows completely */
        min-height: 45px;
    }

    .day-cell {
        min-height: 45px !important;
        padding: 2px;
        align-items: center;
    }

    .day-number-container {
        justify-content: center;
        width: 100%;
    }

    .day-number {
        font-size: 0.75rem;
        width: 18px;
        height: 18px;
    }

    .event-bar {
        display: none; /* Hide spanning bars */
    }

    .mobile-dots-container {
        display: flex; /* Show location dots */
    }

    .mobile-details-drawer {
        display: block; /* Show detail area */
    }

    .schedule-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .schedule-item-right {
        text-align: left;
        margin-left: 0;
        align-items: flex-start;
        min-width: auto;
        border-top: 1px dashed var(--card-border);
        width: 100%;
        padding-top: 0.5rem;
    }

    .schedule-item-left {
        gap: 0.75rem;
    }
}
