/* ============================================================
   NEW UI – DIGITAL CLASSROOM CALENDAR (mwl-calendar)
   Visual restyle of the Angular Bootstrap Calendar library to
   match New UI design system: card wrapper, today badge,
   segmented toolbar pills, and dropdown styling.

   Kill-switch: every selector in this file requires BOTH
   .is-myincite-ui (clientId === 'myincite' AND New UI toggle on)
   AND .nui-modern-pages (static class on #InciteWrapper).

   No !important battles needed: the compiled LESS calendar rules
   in style.css carry no !important, so scoping specificity wins.

   prefers-reduced-motion: transitions are disabled.

   SCOPING NOTE (added after review): .btn-group is used in 320
   templates and .textbox.combo (EasyUI) in ~50 unrelated controllers
   app-wide (assessment items, standards search, teach digital
   classrooms, curriculum, etc.) — bare selectors would have reskinned
   toolbars and comboboxes across the entire application. mwl-calendar
   is also used on other unrelated calendar screens (communities admin,
   curriculum, PL events). `<classroom-calendar>` renders as a literal
   custom element (selector confirmed in calendar.component.js) —
   every rule below is scoped under it so only this screen is affected.
   ============================================================ */

/* ── COLOR OVERRIDES (if needed beyond --nui-* defaults) ── */
.is-myincite-ui.nui-modern-pages {
    --nuic-brand-blue: #0074C5;
    --nuic-teal: #00AEC4;
    --nuic-purple: #8B5CB0;
    --nuic-gold: #D98E32;
}

/* ========================================================================== */
/* 1. CARD WRAP                                                              */
/* ========================================================================== */
/* Apply card treatment to the mwl-calendar element: white background,
   rounded corners, soft shadow. Grid borders inside stay visible. */
.is-myincite-ui.nui-modern-pages classroom-calendar mwl-calendar {
    display: block;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 14px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

/* ========================================================================== */
/* 2. TODAY HIGHLIGHT BADGE                                                  */
/* ========================================================================== */
/* Replace flat pale-green cell wash with:
   - A subtle 1-2px brand-blue border on the cell
   - A circular badge (28-32px) behind just the day number
     with brand blue background and white bold text */

.is-myincite-ui.nui-modern-pages classroom-calendar mwl-calendar .cal-day-today {
    background-color: transparent;
    border: 2px solid var(--nuic-brand-blue);
}

.is-myincite-ui.nui-modern-pages classroom-calendar mwl-calendar .cal-day-today span[data-cal-date] {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background-color: var(--nuic-brand-blue);
    color: #fff;
    font-weight: bold;
    border-radius: 50%;
    margin: 0 !important;
    opacity: 1 !important;
}

/* ========================================================================== */
/* 3. TOOLBAR SEGMENTED PILLS                                                */
/* ========================================================================== */
/* Restyle both .btn-group clusters (Previous/Today/Next and Year/Month/Week/Day)
   into clean segmented-pill controls:
   - Light gray/white track background
   - No harsh individual button borders between segments
   - .active segment gets solid brand-blue fill with white bold text + subtle shadow
   - Inactive segments are transparent with slate text and hover tint */

.is-myincite-ui.nui-modern-pages classroom-calendar .btn-group {
    display: inline-flex;
    background-color: #f3f4f6;
    border-radius: 8px;
    padding: 2px;
    gap: 0;
}

.is-myincite-ui.nui-modern-pages classroom-calendar .btn-group .btn {
    border: none;
    border-radius: 6px;
    background-color: transparent;
    color: var(--nui-text-body);
    font-weight: 600;
    padding: 8px 14px;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    margin: 0;
}

.is-myincite-ui.nui-modern-pages classroom-calendar .btn-group .btn:hover {
    background-color: #e5e7eb;
    color: var(--nui-text-dark);
}

.is-myincite-ui.nui-modern-pages classroom-calendar .btn-group .btn.active,
.is-myincite-ui.nui-modern-pages classroom-calendar .btn-group label.btn.active {
    background-color: var(--nuic-brand-blue);
    color: #fff;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 116, 197, 0.2);
}

.is-myincite-ui.nui-modern-pages classroom-calendar .btn-group .btn.active:hover,
.is-myincite-ui.nui-modern-pages classroom-calendar .btn-group label.btn.active:hover {
    background-color: color-mix(in srgb, var(--nuic-brand-blue) 92%, black);
}

/* Ensure radio-button labels in the Year/Month/Week/Day group also style correctly */
.is-myincite-ui.nui-modern-pages classroom-calendar .btn-group label.btn {
    margin: 0;
    cursor: pointer;
}

/* Keep the "Add Calendar Event" button as a normal solid primary button
   (not part of a segmented group) — it already gets the new-ui-pages style,
   just ensure radius and shadow consistency */
.is-myincite-ui.nui-modern-pages classroom-calendar .btn-primary:not(.btn-group .btn) {
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 116, 197, 0.1);
}

/* ========================================================================== */
/* 4. "SELECT CALENDAR(S)" DROPDOWN – CLOSED STATE ONLY                       */
/* ========================================================================== */
/* Style only the always-visible CLOSED trigger box (#calendarSelect wrapped
   in a .textbox.combo container from EasyUI) with:
   - White background
   - 1.5px border #dbe2ea (consistent with other New UI trigger fields)
   - 8px border-radius
   - Brand-blue border on hover/focus

   DEFERRED: Do NOT style the open dropdown panel (.combo-panel appended
   to <body>) — that requires live browser inspection to verify DOM location.
   Note in final report. */

.is-myincite-ui.nui-modern-pages classroom-calendar .textbox.combo {
    background-color: #fff;
    border: 1.5px solid #dbe2ea;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.is-myincite-ui.nui-modern-pages classroom-calendar .textbox.combo:hover {
    border-color: var(--nuic-brand-blue);
}

.is-myincite-ui.nui-modern-pages classroom-calendar .textbox.combo.textbox-focused {
    border-color: var(--nuic-brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 116, 197, 0.1);
}

.is-myincite-ui.nui-modern-pages classroom-calendar .textbox.combo .textbox-text {
    color: var(--nui-text-body);
    font-family: var(--nui-font);
}

.is-myincite-ui.nui-modern-pages classroom-calendar .textbox.combo .textbox-addon .textbox-icon.combo-arrow {
    color: var(--nui-text-secondary);
}

/* ========================================================================== */
/* 5. REDUCED MOTION                                                         */
/* ========================================================================== */
/* Disable transitions for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .is-myincite-ui.nui-modern-pages classroom-calendar mwl-calendar,
    .is-myincite-ui.nui-modern-pages classroom-calendar mwl-calendar span[data-cal-date],
    .is-myincite-ui.nui-modern-pages classroom-calendar .btn-group .btn,
    .is-myincite-ui.nui-modern-pages classroom-calendar .textbox.combo {
        transition: none !important;
    }
}
