/* ============================================================
   STRAATZAKEN026 — Modal Styles
   ============================================================ */

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

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

.modal-md {
    width: 560px;
}

.modal-lg {
    width: 720px;
}

.modal-xl {
    width: 900px;
}

.modal-full {
    width: 95vw;
    height: 90vh;
}

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
    color: var(--text-color);
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

/* Modal Animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-animated {
    animation: modalSlideIn 0.3s ease forwards;
}

/* Slide Modal (from bottom) */
.modal-slide {
    top: auto;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    bottom: 0;
    max-height: 80vh;
}

.modal-slide.active {
    transform: translateX(-50%) translateY(0);
}

/* Full Screen Modal */
.modal-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    top: 0;
    left: 0;
    transform: translate(0, 0);
    border-radius: 0;
}

.modal-fullscreen.active {
    transform: translate(0, 0);
}

/* Modal with Image */
.modal-image {
    max-width: 90vw;
    max-height: 90vh;
    padding: 0;
    background: #000;
}

.modal-image img {
    max-width: 100%;
    max-height: 85vh;
    display: block;
    margin: 0 auto;
}

/* Confirmation Modal */
.modal-confirm {
    text-align: center;
    padding: 2rem;
}

.modal-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.modal-confirm-icon.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.modal-confirm-icon.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.modal-confirm-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Form in Modal */
.modal .form-group {
    margin-bottom: 1rem;
}

.modal .form-input,
.modal .form-select,
.modal textarea {
    width: 100%;
}

/* Loading State */
.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.modal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Responsive */
@media (max-width: 640px) {
    .modal {
        width: 95vw;
        max-height: 85vh;
    }
    
    .modal-sm,
    .modal-md,
    .modal-lg,
    .modal-xl {
        width: 95vw;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}
