/* ===================================================================
   MODAL STYLES
   =================================================================== */

/* Modal v2 - Base styles for new modal system */
.modal-v2 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}

.modal-content-v2 {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header-v2 {
    padding: 24px 30px;
    border-bottom: 1px solid #E9ECEF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0066CC, #00509E);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header-v2 h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.modal-close-v2 {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close-v2:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body-v2 {
    padding: 30px;
}

.modal-footer-v2 {
    padding: 20px 30px;
    border-top: 1px solid #E9ECEF;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #F8F9FA;
    border-radius: 0 0 12px 12px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

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

.modal-md {
    width: 600px;
    max-width: 90%;
}

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

.modal-xl {
    width: 1000px;
    max-width: 95%;
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #E9ECEF;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1A1A1A;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6C757D;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #F8F9FA;
    color: #1A1A1A;
}

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

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

/* Form Styles Inside Modal */
.modal-body form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-body .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-body .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-body .form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.modal-body .form-control {
    padding: 10px 12px;
    border: 1px solid #CED4DA;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.modal-body .form-control:focus {
    outline: none;
    border-color: #0066CC;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.modal-body textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Alert in Modal */
.modal-body .alert {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.modal-body .alert-info {
    background: #E6F2FF;
    border: 1px solid #B3D9FF;
    color: #004080;
}

.modal-body .alert i {
    margin-top: 2px;
}

/* Pulse Animation for highlighting */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 102, 204, 0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .modal-container {
        width: 95% !important;
        margin: 20px;
    }

    .modal-body .form-row {
        grid-template-columns: 1fr;
    }
}
