/**
 * Unified Modal Manager Styles
 * Clean, modern modal system with smooth animations
 */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10000;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

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

/* Modal Container */
.modal-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    animation: modalSlideIn 0.3s ease forwards;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

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

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.modal-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    flex: 1;
}

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

.modal-message {
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
    margin: 0;
    white-space: pre-wrap;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Modal Buttons */
.modal-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    min-width: 80px;
}

.modal-btn:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Variants */
.btn-primary {
    background: #3b82f6;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

.btn-success {
    background: #10b981;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

/* Responsive Design */
@media (max-width: 640px) {
    .modal-container {
        max-width: 95vw;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 12px 20px;
        flex-direction: column-reverse;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .modal-container {
        background: #1f2937;
    }
    
    .modal-header,
    .modal-footer {
        background: #111827;
        border-color: #374151;
    }
    
    .modal-title {
        color: #f9fafb;
    }
    
    .modal-message {
        color: #d1d5db;
    }
    
    .btn-secondary {
        background: #374151;
        color: #d1d5db;
    }
    
    .btn-secondary:hover:not(:disabled) {
        background: #4b5563;
    }
}

/* Special modal types */
.modal-overlay.modal-danger .modal-header {
    background: #fef2f2;
    border-bottom-color: #fecaca;
}

.modal-overlay.modal-success .modal-header {
    background: #f0fdf4;
    border-bottom-color: #bbf7d0;
}

.modal-overlay.modal-warning .modal-header {
    background: #fffbeb;
    border-bottom-color: #fde68a;
}

/* Loading state */
.modal-loading .modal-btn {
    position: relative;
    color: transparent;
}

.modal-loading .modal-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
























































