/*
 * admin-makeups.css — shared styles for the admin "outstanding make-up owed"
 * card list + book-make-up modal flow.
 *
 * These classes are copied faithfully from frontend/admin/calendar.html's inline
 * <style> block so the elements render identically wherever the shared
 * admin-makeups.js module is used (calendar.html today keeps its own inline copy;
 * a follow-up migrates it onto this file — see tb-gdo follow-up bead).
 *
 * Owned by admin-makeups.js. Do not fork these rules per-page.
 */

/* ------------------------------------------------------------------ */
/* Modal shell                                                        */
/* ------------------------------------------------------------------ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1100;
}

.modal-overlay.visible {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.25rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted, #666);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-text, #333);
}

.modal-body {
    padding: 1.5rem;
}

.booking-detail {
    margin-bottom: 1rem;
}

.booking-detail:last-child {
    margin-bottom: 0;
}

.booking-detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted, #666);
    margin-bottom: 0.25rem;
}

.booking-detail-value {
    font-size: 1rem;
    color: var(--color-text, #333);
}

.modal-actions {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border, #e0e0e0);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-actions h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--color-text-muted, #666);
}

/* ------------------------------------------------------------------ */
/* Action links + forms inside the modal                              */
/* ------------------------------------------------------------------ */
.action-link {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--color-background, #f8f9fa);
    border-radius: 6px;
    color: var(--color-primary, #2c5aa0);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.action-link:hover {
    background: #e9ecef;
}

.action-link--danger {
    color: #dc3545;
}

.action-link--warning {
    color: #856404;
}

.action-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.action-link--book-makeup {
    background: var(--color-primary, #2c5aa0);
    color: white !important;
}

.action-link--book-makeup:hover {
    background: #234a80;
}

.action-form {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--color-background, #f8f9fa);
    border-radius: 8px;
}

.action-form.visible {
    display: block;
}

.action-form__title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.action-form__group {
    margin-bottom: 1rem;
}

.action-form__label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--color-text-muted, #666);
}

.action-form__input,
.action-form__textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
}

.action-form__textarea {
    min-height: 60px;
    resize: vertical;
}

.action-form__buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.action-form__btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    font-family: inherit;
}

.action-form__btn--primary {
    background: var(--color-primary, #2c5aa0);
    color: white;
}

.action-form__btn--primary:hover {
    background: #234a80;
}

.action-form__btn--danger {
    background: #dc3545;
    color: white;
}

.action-form__btn--danger:hover {
    background: #c82333;
}

.action-form__btn--secondary {
    background: #e9ecef;
    color: var(--color-text, #333);
}

.action-form__btn--secondary:hover {
    background: #dee2e6;
}

/* ------------------------------------------------------------------ */
/* Success/error messages in modal                                    */
/* ------------------------------------------------------------------ */
.modal-message {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

.modal-message.visible {
    display: block;
}

.modal-message--success {
    background: #d4edda;
    color: #155724;
}

.modal-message--error {
    background: #f8d7da;
    color: #721c24;
}

/* ------------------------------------------------------------------ */
/* Cancellation cards (the owed make-up list)                         */
/* ------------------------------------------------------------------ */
.cancellations-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cancellations-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    justify-content: center;
    color: var(--color-text-muted, #666);
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--color-primary, #2c5aa0);
    border-radius: 50%;
    animation: am-spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes am-spin {
    to { transform: rotate(360deg); }
}

.cancellation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--color-background, #f8f9fa);
    border-radius: 6px;
    border-left: 4px solid;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.cancellation-card:hover {
    background: #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cancellation-card--student {
    border-left-color: #dc3545;
}

.cancellation-card--teacher {
    border-left-color: #fd7e14;
}

.cancellation-card__main {
    flex: 1;
}

.cancellation-card__title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.cancellation-card__details {
    font-size: 0.8rem;
    color: var(--color-text-muted, #666);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.cancellation-card__badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.cancellation-card__badge--student {
    background: #f8d7da;
    color: #721c24;
}

.cancellation-card__badge--teacher {
    background: #fff3cd;
    color: #856404;
}

.cancellation-card__mu-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.cancellation-card__mu-value {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-primary, #2c5aa0);
}

.cancellation-card__mu-label {
    font-size: 0.7rem;
    color: var(--color-text-muted, #666);
    text-transform: uppercase;
}

.cancellation-status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.cancellation-status-badge--waiting {
    background: #fff3cd;
    color: #856404;
}

.cancellation-status-badge--granted {
    background: #d4edda;
    color: #155724;
}

.cancellation-status-badge--denied {
    background: #f8d7da;
    color: #721c24;
}

/* ------------------------------------------------------------------ */
/* Module-owned loading overlay (sits above the make-up modal)        */
/* ------------------------------------------------------------------ */
.am-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1200;
}

.am-loading-overlay.visible {
    display: flex;
}

.am-loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text, #333);
}

/* ------------------------------------------------------------------ */
/* Create-booking gate: warning block + submit-only check status      */
/* ------------------------------------------------------------------ */
.makeup-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.makeup-warning__title {
    font-weight: 700;
    color: #856404;
    margin-bottom: 0.5rem;
}

.makeup-warning__text {
    font-size: 0.875rem;
    color: #856404;
    margin: 0 0 1rem 0;
}

.makeup-warning__override {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ffe08a;
    font-size: 0.9rem;
    font-weight: 600;
    color: #721c24;
    cursor: pointer;
}

.makeup-warning__override input {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.makeup-check-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted, #666);
}
