/* ============================
   MONTH GRID LAYOUT
   ============================ */

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    padding: 6px;
    border: 1px solid #d0d0d0;
    min-height: 90px;
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
}

    .calendar-day.outside-month {
        background: #f3f3f3;
        color: #9a9a9a;
    }

.date-label {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.85rem;
}



/* ============================
   BADGES (Training/Workshop/Performance)
   ============================ */

.calendar-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    border-radius: 4px;
    margin-bottom: 2px;
    cursor: pointer;
    max-width: 100%;
    line-height: 1;
}

    .calendar-badge.primary {
        background-color: #2FA4C9;
        color: #ffffff;
    }

    .calendar-badge.warning {
        background-color: #ffe07a;
        color: #000000;
    }

    .calendar-badge.danger {
        background-color: #d64541;
        color: #ffffff;
    }

    .calendar-badge.more {
        background-color: #d0d0d0;
        color: #333333;
    }

    .calendar-badge.primary:hover   { background-color: #298FB0; }
    .calendar-badge.warning:hover   { background-color: #f5d067; }
    .calendar-badge.danger:hover    { background-color: #b93a36; }
    .calendar-badge.more:hover      { background-color: #bfbfbf; }

    .calendar-badge.primary:active  { background-color: #247D9A; }
    .calendar-badge.warning:active  { background-color: #eac25c; }
    .calendar-badge.danger:active   { background-color: #a23330; }

    .calendar-badge:focus {
        outline: none;
        box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(47, 164, 201, 0.5);
    }



/* ============================
   CALENDAR PAGE LAYOUT
   ============================ */

.calendar-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Details panel hidden on mobile until an event is selected */
.calendar-details-panel {
    display: none;
}

.calendar-details-panel.has-event {
    display: block;
}

@media (min-width: 992px) {
    .calendar-layout {
        grid-template-columns: 1fr 340px;
        align-items: start;
    }

    /* Details panel always visible on desktop */
    .calendar-details-panel {
        display: block;
    }
}



/* ============================
   MOBILE: compact cells
   ============================ */

@media (max-width: 575px) {
    .calendar-day {
        min-height: 52px;
        padding: 3px;
    }

    .date-label {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }

    .calendar-badge {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
}



/* ============================
   FILTER BAR
   ============================ */

.calendar-filters {
    background: #f8f9fa;
    overflow: hidden;
}

/* Clickable header row */
.calendar-filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
    gap: 0.5rem;
}

.calendar-filters-toggle:hover {
    background: #eef7fb;
}

.calendar-filters-toggle-title {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.calendar-filters-toggle-chevron {
    font-size: 1.1rem;
    line-height: 1;
    color: #888;
    transition: transform 0.2s ease;
    display: inline-block;
    transform: rotate(0deg);
}

.calendar-filters-toggle-chevron.expanded {
    transform: rotate(180deg);
}

/* Body shown when expanded */
.calendar-filters-body {
    padding: 0.25rem 0.75rem 0.6rem;
    border-top: 1px solid #dee2e6;
}

/* One filter row: label + chips side by side, wraps on mobile */
.filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.3rem 0;
}

/* Thin horizontal line between row groups */
.filter-row-divider {
    height: 1px;
    background: #dee2e6;
    margin: 0.2rem 0;
}

/* Label column — fixed width so chips always start at the same x */
.filter-chip-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    white-space: nowrap;
    min-width: 5.5rem;
}

/* A group of chips in a row */
.filter-chip-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

/* Base chip */
.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid transparent;
    background: #fff;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    white-space: nowrap;
    line-height: 1.4;
}

/* Inactive states — subtle outline */
.filter-chip.chip-primary,
.filter-chip.chip-training,
.filter-chip.chip-workshop,
.filter-chip.chip-performance   { border-color: #2FA4C9; color: #2FA4C9; }
.filter-chip.chip-warning       { border-color: #c9b05f; color: #9a7e1a; }
.filter-chip.chip-danger        { border-color: #d64541; color: #d64541; }

/* Active (selected) states — filled */
.filter-chip.chip-primary.active,
.filter-chip.chip-training.active,
.filter-chip.chip-workshop.active,
.filter-chip.chip-performance.active  { background: #2FA4C9; color: #fff; border-color: #2FA4C9; }
.filter-chip.chip-warning.active      { background: #ffe07a; color: #000; border-color: #ffe07a; }
.filter-chip.chip-danger.active       { background: #d64541; color: #fff; border-color: #d64541; }

/* Hover — slightly darken */
.filter-chip.chip-primary:hover,
.filter-chip.chip-training:hover,
.filter-chip.chip-workshop:hover,
.filter-chip.chip-performance:hover   { background: #e8f6fb; }
.filter-chip.chip-warning:hover       { background: #fffbe8; }
.filter-chip.chip-danger:hover        { background: #fdf0f0; }

.filter-chip.chip-primary.active:hover,
.filter-chip.chip-training.active:hover,
.filter-chip.chip-workshop.active:hover,
.filter-chip.chip-performance.active:hover  { background: #298FB0; }
.filter-chip.chip-warning.active:hover      { background: #f5d067; }
.filter-chip.chip-danger.active:hover       { background: #b93a36; }

/* Align inline SVG icons inside chips */
.filter-chip svg {
    vertical-align: middle;
    flex-shrink: 0;
}

.filter-chip:focus {
    outline: none;
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(47, 164, 201, 0.4);
}

/* On very small screens the label sits above the chips */
@media (max-width: 480px) {
    .filter-chip-label {
        min-width: unset;
        width: 100%;
    }
}
