/* ═══════════════════════════════════════════
   SCHEDULE SECTION
   ═══════════════════════════════════════════ */

/* ── Header ── */
.schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.schedule-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-clr);
    letter-spacing: -0.01em;
}

.add-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px dashed rgba(169, 204, 187, 0.3);
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent-clr);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.add-row-btn:hover {
    background: rgba(61, 220, 151, 0.07);
    border-color: rgba(61, 220, 151, 0.35);
    color: var(--green-bright);
}

/* ── Grid ── */
.schedule-grid {
    display: grid;
    grid-template-columns: 88px repeat(5, 1fr);
    gap: 7px;
}

/* ── Celda base ── */
.cell {
    min-height: 72px;       /* era 52px */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, transform 120ms ease;
    user-select: none;
    padding: 10px 6px;
    line-height: 1.3;
    word-break: break-word;
}

/* ── Header cells ── */
.cell.header {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(169, 204, 187, 0.1);
    color: var(--secondary-text-clr);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: default;
    min-height: 42px;
}

/* ── Time input ── */
.time-input {
    min-height: 72px;
    border-radius: 12px;
    border: 1px solid rgba(169, 204, 187, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-clr);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.04em;
    outline: none;
    cursor: text;
    padding: 6px 4px;
    transition: border-color 150ms ease, background 150ms ease;
    width: 100%;
    box-sizing: border-box;
}

.time-input:focus {
    border-color: rgba(61, 220, 151, 0.4);
    background: rgba(255, 255, 255, 0.07);
    color: var(--green-bright);
}

/* ── Celda vacía ── */
.cell:not(.header):not(.filled) {
    background: rgba(255, 255, 255, 0.025);
    border: 1px dashed rgba(169, 204, 187, 0.14);
    color: rgba(169, 204, 187, 0.25);
    font-size: 16px;
    font-weight: 300;
}

.cell:not(.header):not(.filled):hover {
    background: rgba(61, 220, 151, 0.06);
    border-color: rgba(61, 220, 151, 0.28);
    color: rgba(61, 220, 151, 0.5);
    transform: scale(1.02);
}

/* ── Celda con materia ── */
.cell.filled {
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}

/* Brillo interno */
.cell.filled::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    pointer-events: none;
}

.cell.filled:hover {
    filter: brightness(1.12);
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* ── Modal del horario ── */
#schedule-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: opacity 220ms ease;
}

#schedule-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.schedule-modal-card {
    width: 100%;
    max-width: 360px;
    background: #0a3d29;
    border: 1px solid rgba(169, 204, 187, 0.18);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.07);
    overflow: hidden;
    transform: translateY(0) scale(1);
    transition: transform 220ms cubic-bezier(.4,0,.2,1);
}

#schedule-modal.hidden .schedule-modal-card {
    transform: translateY(16px) scale(0.97);
}

.schedule-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 0;
}

.schedule-modal-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #e8efe9;
}

.schedule-modal-body {
    padding: 1.1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schedule-modal-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(169, 204, 187, 0.18);
    background: rgba(255, 255, 255, 0.05)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237fb89a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
        no-repeat right 14px center;
    color: #e8efe9;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.schedule-modal-select:focus {
    border-color: rgba(61, 220, 151, 0.45);
    background-color: rgba(255, 255, 255, 0.07);
}

.schedule-modal-select option { background: #082e21; }

.schedule-modal-footer {
    display: flex;
    gap: 8px;
    padding: 0 1.5rem 1.5rem;
}

.schedule-modal-footer .btn-cancel { flex: 1; }
.schedule-modal-footer .btn-add    { flex: 2; }

/* Botón de limpiar slot */
.btn-clear-slot {
    width: 100%;
    padding: 9px;
    border-radius: 10px;
    border: 1px solid rgba(255, 80, 80, 0.2);
    background: rgba(255, 80, 80, 0.06);
    color: #ff9090;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: background 150ms ease;
    margin-bottom: 0.25rem;
}

.btn-clear-slot:hover { background: rgba(255, 80, 80, 0.14); }

/* ── Mobile ── */
@media (max-width: 800px) {
    .schedule-grid {
        grid-template-columns: 62px repeat(5, 1fr);
        gap: 4px;
    }

    .cell {
        min-height: 56px;
        font-size: 10.5px;
        border-radius: 7px;
        padding: 4px 2px;
    }

    .cell.header {
        font-size: 9px;
        min-height: 30px;
        letter-spacing: 0.04em;
    }

    .time-input {
        min-height: 56px;
        font-size: 10px;
        border-radius: 7px;
    }

    .cell.filled { font-size: 9.5px; }
}