/**
 * EduWorker - Modal Styles
 */

/* ==========================================================================
   Modal Overlay
   ========================================================================== */

.eduworker-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.eduworker-modal.is-open {
    display: flex;
}

/* Backdrop */

.eduworker-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    animation: eduworkerFadeIn 0.2s ease;
}

/* Container */

.eduworker-modal__container {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow-y: auto;
    z-index: 1;
    animation: eduworkerSlideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 32px;
}

/* Close Button */

.eduworker-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #50575e;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    z-index: 2;
}

.eduworker-modal__close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1d2327;
}

/* Loading Spinner */

.eduworker-modal__spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.eduworker-modal.is-loading .eduworker-modal__spinner {
    display: block;
}

.eduworker-modal.is-loading .eduworker-modal__content {
    visibility: hidden;
    min-height: 200px;
}

.eduworker-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: eduworkerSpin 0.8s linear infinite;
}

/* Modal Error */

.eduworker-modal-error {
    text-align: center;
    padding: 40px 20px;
    color: #9a2020;
}

/* Body scroll lock */

body.eduworker-modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes eduworkerFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes eduworkerSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes eduworkerSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .eduworker-modal {
        padding: 0;
    }

    .eduworker-modal__container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 20px;
        padding-top: 48px;
    }
}

@media (max-width: 480px) {
    .eduworker-modal__container {
        padding: 16px;
        padding-top: 44px;
    }
}
