/* =============================================================
   Common Modal — shared overlay + content + close button.
   Reusable across pages (rule R5). Pair with a body scroll-lock
   in JS when opening (rule R2): document.body.style.overflow='hidden'.
   ============================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #fff;
    width: 900px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;          /* R2: long content scrolls inside the modal */
    border-radius: 12px;
    padding: 40px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-close svg {
    width: 28px;
    height: 28px;
}

/* ===== dark theme ===== */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
}
[data-theme="dark"] .modal-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .modal-close svg { stroke: #94a3b8; }
[data-theme="dark"] .modal-close:hover svg { stroke: #f8fafc; }

/* ===== responsive (R6) ===== */
@media (max-width: 600px) {
    .modal-content { padding: 24px 16px; }
}
