/* ==========================
   Modal System - Reusable styles
   ========================== */

/* Backdrop overlay for all modals */
.kb-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Hide modal when hidden attribute is present */
.kb-modal-backdrop[hidden] {
    display: none;
}

/* The modal card itself */
.kb-modal {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
    width: 100%;
    max-width: 520px;
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 90vh;
    overflow-y: auto;
}

/* Large modal variant */
.kb-modal--large {
    max-width: 800px;
}

/* Extra large modal variant */
.kb-modal--xlarge {
    max-width: 1000px;
}

/* Modal header */
.kb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kb-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary);
}

/* Modal body */
.kb-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Modal footer */
.kb-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .kb-modal {
        margin: 0 1rem;
        max-width: calc(100% - 2rem);
    }

    .kb-modal--large,
    .kb-modal--xlarge {
        max-width: calc(100% - 2rem);
    }
}
