﻿/* Backdrop / overlay */
.modal-overlay {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0; */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45); /* dim background */
    backdrop-filter: blur(2px); /* subtle blur on supporting browsers */
    z-index: 10000;
    padding: 1.25rem; /* ensures spacing on small screens */
    transition: opacity 200ms ease;
}

/* Modal panel */
.modal {
    width: 100%;
    max-width: 680px; /* change to taste */
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* keeps content from overflowing viewport */
    transform: translateY(8px) scale(0.995);
    opacity: 0;
    animation: modalIn 200ms ease forwards;
}

/* Entrance animation */
@keyframes modalIn {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid #eee;
    background: linear-gradient(180deg, rgba(0,0,0,0.02), transparent);
}

/* Title */
.modal-title {
    margin: 0;
    font-size: 1.0625rem; /* ~17px */
    font-weight: 600;
    color: #111827;
}

/* Close button (text-based) */
.modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: #6b7280;
    border-radius: 6px;
}

    .modal-close:hover,
    .modal-close:focus {
        background: rgba(0,0,0,0.04);
        color: #111827;
        outline: none;
        box-shadow: 0 0 0 3px rgba(59,130,246,0.12); /* faint focus ring */
    }

/* Body */
.modal-body {
    padding: 1rem 1.25rem;
    overflow: auto; /* scroll if content too tall */
    flex: 1 1 auto;
    background: #fff;
}

/* Footer */
.modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #fafafa;
}

/* Buttons */
.modal-btn {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    font-weight: 600;
}

    .modal-btn:hover {
        background: #f3f4f6;
    }

/* Responsive tweaks */
@media (max-width: 520px) {
    .modal {
        max-width: 100%;
        border-radius: 10px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }
}
