/* Modal Component - BEM Methodology */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
}

.modal--open {
    display: flex;
}

.modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    animation: fadeIn var(--transition-base);
}

.modal__content {
    position: relative;
    z-index: var(--z-modal);
    background-color: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp var(--transition-base);
}

.modal__header {
    padding: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: var(--border-width) solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.modal__close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-md);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.modal__close:hover {
    background-color: var(--color-neutral-100);
    color: var(--color-text-primary);
}

.modal__body {
    padding: var(--space-xl);
}

.modal__footer {
    padding: var(--space-lg) var(--space-xl);
    border-top: var(--border-width) solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

