@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@400;600;700&display=swap');

.school-calendar-widget,
.school-calendar-widget *,
.school-calendar-widget *::before,
.school-calendar-widget *::after {
    box-sizing: border-box;
}

.school-calendar-widget {
    width: 100%;
    margin: 0 auto;
    font-family: 'Prompt', system-ui, -apple-system, sans-serif;
    padding: 16px;
    border: 1px solid rgba(16, 24, 40, 0.1);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.03), 0 1px 4px rgba(16, 24, 40, 0.01);
    --sc-accent: #2563eb;
}

.sc-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px
}

.sc-cal-header .sc-month-title {
    font-weight: 700;
    color: var(--sc-accent);
    font-size: 22px
}

.sc-cal-header button {
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 14px
}

.sc-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden
}

.sc-grid-row {
    display: contents
}

.sc-grid-weekdays .sc-grid-cell {
    font-weight: 700;
    text-align: center;
    color: #1e293b;
    padding: 14px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: 14.5px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.sc-grid-cell {
    min-height: 0;
    background: #fff;
    padding: 0;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1;
    position: relative;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.sc-grid-empty {
    background: #fdfdfe;
    aspect-ratio: 1 / 1;
    opacity: 0.5;
    background-image: radial-gradient(#e2e8f0 0.5px, transparent 0.5px);
    background-size: 10px 10px;
}

.sc-grid-day {
    background: #fff;
    transition: background 0.2s;
    /* Removed padding to let aspect-ratio and internal flex control layout */
}

.sc-grid-day:hover {
    background: #f1f5f9;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
    z-index: 5;
}

.sc-day-number {
    font-weight: 700;
    color: #1e293b;
    padding: 10px 12px 6px;
    font-size: 17px;
    z-index: 10;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.sc-grid-day:hover .sc-day-number {
    transform: scale(1.1);
}

.sc-day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    min-height: 0;
    padding: 0 6px 6px;
}

.sc-day-events::-webkit-scrollbar {
    width: 4px
}

.sc-day-events::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px
}

.sc-event-badge {
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--sc-accent);
    color: #fff;
    font-size: 13.5px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
    margin-bottom: 8px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sc-event-badge:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    background: color-mix(in srgb, var(--sc-accent), white 10%);
}

.sc-more {
    color: var(--sc-accent);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 5px;
    cursor: pointer
}

.sc-loading {
    padding: 16px;
    text-align: center
}

/* Today highlight styling */
.sc-grid-day.sc-today {
    background: #fff !important;
    box-shadow: inset 0 0 0 2px var(--sc-accent) !important;
    z-index: 10;
}

.sc-today-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--sc-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
    z-index: 5;
}

.sc-today-dot {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--sc-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    pointer-events: none;
}

/* Modal styles */
.sc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999
}

.sc-modal-box {
    background: #fff;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.2);
    border: 1px solid rgba(16, 24, 40, 0.05);
}

.sc-modal-close {
    position: absolute;
    right: 18px;
    top: 12px;
    background: transparent;
    border: 0;
    font-size: 22px;
    color: #334155;
    cursor: pointer
}

.sc-modal-body h3 {
    margin-top: 0;
    margin-bottom: 8px
}

.sc-modal-item {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.sc-modal-item-title {
    font-weight: 700
}

.sc-modal-item-meta {
    color: #475569;
    font-size: 13px;
    margin-top: 4px
}

.sc-modal-item-loc {
    color: #334155;
    font-size: 13px;
    margin-top: 6px
}

.sc-modal-item-notes {
    color: #475569;
    font-size: 13px;
    margin-top: 6px
}

.sc-event-badge {
    cursor: pointer
}

.sc-more {
    cursor: pointer;
    color: var(--sc-accent)
}

/* Continuous event span styles removed - badges are now used exclusively for clarity */


/* Create form tweaks */
.sc-modal-body .form-table {
    width: 100%;
    margin-bottom: 8px
}

.sc-modal-body .form-table th {
    width: 120px;
    text-align: left;
    padding: 6px
}

.sc-modal-body .form-table td {
    padding: 6px
}

.sc-modal-body input,
.sc-modal-body textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #e6edf3;
    border-radius: 6px
}

/* Borrowed palette & UI tokens from index.html */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1)
}

.btn-primary {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
    padding: 8px 14px;
    border-radius: 10px;
    border: 0
}

.btn-primary:hover {
    background: linear-gradient(90deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px)
}

.event-badge {
    font-size: 0.72rem;
    padding: 5px 8px;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: relative
}

.event-badge:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12)
}

/* Day-specific background colors (Modern Pastel Gradients) */
.sunday {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe3e3 100%)
}

.monday {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%)
}

.tuesday {
    background: linear-gradient(135deg, #fff0f6 0%, #ffdeeb 100%)
}

.wednesday {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%)
}

.thursday {
    background: linear-gradient(135deg, #fffaf3 0%, #feebc8 100%)
}

.friday {
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%)
}

.saturday {
    background: linear-gradient(135deg, #faf5ff 0%, #e9d8fd 100%)
}

/* Day-specific text colors */
.text-sunday {
    color: #dc2626
}

.text-monday {
    color: #d97706
}

.text-tuesday {
    color: #db2777
}

.text-wednesday {
    color: #16a34a
}

.text-wednesday-night {
    color: #475569
}

.text-thursday {
    color: #ea580c
}

.text-friday {
    color: #2563eb
}

.text-saturday {
    color: #7c3aed
}

/* Header gradients for weekdays (if needed) */
.header-sunday {
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%)
}

.header-monday {
    background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%)
}

.header-tuesday {
    background: linear-gradient(90deg, #db2777 0%, #ec4899 100%)
}

.header-wednesday {
    background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%)
}

.header-thursday {
    background: linear-gradient(90deg, #ea580c 0%, #f97316 100%)
}

.header-friday {
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%)
}

.header-saturday {
    background: linear-gradient(90deg, #7c3aed 0%, #a855f7 100%)
}

/* make weekday header cells show white text on gradients */
.sc-grid-weekdays .sc-grid-cell.header-sunday,
.sc-grid-weekdays .sc-grid-cell.header-monday,
.sc-grid-weekdays .sc-grid-cell.header-tuesday,
.sc-grid-weekdays .sc-grid-cell.header-wednesday,
.sc-grid-weekdays .sc-grid-cell.header-thursday,
.sc-grid-weekdays .sc-grid-cell.header-friday,
.sc-grid-weekdays .sc-grid-cell.header-saturday {
    color: #fff;
    font-weight: 700;
    text-align: center;
    padding: 10px 6px;
}

/* Widget header premium styling */
.sc-widget-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 24px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    gap: 20px;
    flex-wrap: wrap;
}

.header-gradient-vibrant {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}

.sc-header-branding {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 300px;
}

.sc-header-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    background: #fff;
}

.sc-header-text {
    display: flex;
    flex-direction: column;
}

.sc-header-title {
    font-weight: 700;
    font-size: 24px;
    line-height: 1.2;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.sc-header-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    line-height: 1.4;
}

.sc-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.sc-header-actions .btn-primary {
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.sc-header-actions .btn-primary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sc-widget-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .sc-header-logo {
        width: 50px;
        height: 50px;
    }

    .sc-header-title {
        font-size: 18px;
    }

    .sc-header-subtitle {
        font-size: 13px;
    }

    .sc-header-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 10px;
    }

    .sc-grid-weekdays .sc-grid-cell {
        font-size: 12px;
        padding: 10px 2px;
    }

    .sc-day-number {
        font-size: 14px;
        padding: 4px 6px;
    }

    .sc-event-badge {
        font-size: 11px;
        padding: 4px 6px;
        min-height: 34px;
    }
}

@media (max-width: 480px) {
    .sc-calendar-grid {
        gap: 0;
    }

    .sc-grid-cell {
        border: 0.5px solid #e2e8f0;
    }
}