
/* Modal Styles */

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    z-index: var(--z-index-modal);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

/* Modal Content */
.modal-content {
    background-color: white;
    margin: auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

/* Modal Header */
.modal-header {
    padding: 20px;
    background: var(--light-color);
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: var(--transition);
}

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

/* Modal Body */
.modal-body {
    padding: 20px;
}

/* Modal Footer */
.modal-footer {
    padding: 15px 20px;
    background: var(--light-color);
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

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

.modal-lg .modal-content {
    max-width: 800px;
}

.modal-xl .modal-content {
    max-width: 1140px;
}

.modal-fullscreen .modal-content {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
}

/* Modal Animations */
@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Confirm Modal */
.modal-confirm .modal-header {
    background: var(--danger-color);
    color: white;
}

.modal-confirm .modal-close {
    color: white;
}

.modal-confirm .modal-body {
    text-align: center;
    padding: 30px;
}

.modal-confirm-icon {
    font-size: 3rem;
    color: var(--danger-color);
    margin-bottom: 20px;
}

/* Success Modal */
.modal-success .modal-header {
    background: var(--success-color);
    color: white;
}

.modal-success .modal-close {
    color: white;
}

/* Info Modal */
.modal-info .modal-header {
    background: var(--info-color);
    color: white;
}

.modal-info .modal-close {
    color: white;
}

/* Modal Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal Backdrop Blur (if supported) */
@supports (backdrop-filter: blur(10px)) {
    .modal {
        backdrop-filter: blur(5px);
    }
}

/* Mobile Modal Adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-fullscreen-mobile .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
    }
}