/* Modal Component Styles */

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--theme-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.is-open .modal-content {
    transform: scale(1);
}

.modal.closing {
    animation: slideDown 0.2s ease forwards;
}

/* Modal Sizes */
.modal.modal-sm {
    width: 400px;
}

.modal.modal-md {
    width: 600px;
}

.modal.modal-lg {
    width: 900px;
}

.modal.modal-xl {
    width: 1200px;
}

.modal.modal-full {
    width: calc(100vw - 4rem);
    height: calc(100vh - 4rem);
}

/* Modal Header */
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--theme-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--theme-text-primary);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--theme-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--theme-bg);
    color: var(--theme-text-primary);
}

/* Modal Body */
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Modal Footer */
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--theme-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.modal-footer.modal-footer-left {
    justify-content: flex-start;
}

.modal-footer.modal-footer-center {
    justify-content: center;
}

.modal-footer.modal-footer-between {
    justify-content: space-between;
}

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

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    to {
        transform: scale(1) translateY(0);
    }
}

@keyframes slideDown {
    to {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
}

/* Responsive - higher specificity to override size variants */
@media (max-width: 768px) {
    .modal.modal-sm,
    .modal.modal-md,
    .modal.modal-lg,
    .modal.modal-xl,
    .modal[style*="width"] {
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }
}
