/* ===== SITE VISITS MODAL STYLES ===== */

/* Modal structure matching site theme */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    background: #ffffff;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem;
    background: #ffffff;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.modal-header .btn-close {
    opacity: 0.6;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--content-bg);
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem;
    background: #ffffff;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* ===== CSMS-LIKE SLIDE MODAL (namespaced) ===== */
@keyframes svSlideInFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes svSlideOutToRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes svFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes svFadeOut { from { opacity: 1; } to { opacity: 0; } }

.sv-slide-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    animation: svFadeIn 0.3s ease-in-out;
}

.sv-slide-modal-overlay.show { display: flex; }
.sv-slide-modal-overlay.closing { animation: svFadeOut 0.3s ease-in-out forwards; }
.sv-slide-modal-overlay.closing .sv-slide-modal-container { animation: svSlideOutToRight 0.4s ease-in forwards; }

.sv-slide-modal-container {
    background: #ffffff;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: svSlideInFromRight 0.4s ease-out;
    overflow: hidden;
}

.sv-slide-modal-header {
    background: #ffffff;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.sv-slide-modal-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sv-slide-modal-content { flex: 1; display: flex; overflow: hidden; }
.sv-slide-modal-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#svModalContent { flex: 1; padding: 2rem; overflow-y: auto; }

.sv-form-navigation { background: #ffffff; border-top: 1px solid #e5e7eb; padding: 1.5rem 2rem; flex-shrink: 0; }

@media (max-width: 768px) {
    .sv-slide-modal-header { padding: 1rem; }
    .sv-slide-modal-header h1 { font-size: 1.25rem; }
    #svModalContent { padding: 1rem; }
    .sv-form-navigation { padding: 1rem; }
}

/* Modal info card using same style as site pages */
.modal-info-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
    padding: 1rem;
    margin-bottom: 1rem;
}

.modal-info-card h6 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.modal-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-info-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Tab styling matching site theme */
.modal .nav-tabs {
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1rem;
    background: none;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
}

.modal .nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0;
    position: relative;
    background: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.modal .nav-tabs .nav-link:hover {
    border: none;
    background: #f8f9fa;
    color: var(--text-primary);
}

.modal .nav-tabs .nav-link.active {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
}

.modal .nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px 2px 0 0;
}

/* Form styling matching site theme */
.modal .form-group,
.modal .mb-3 {
    margin-bottom: 1rem;
}

.modal .form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.modal .form-control,
.modal .form-select {
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 0.875rem;
    background: #ffffff;
    color: var(--text-primary);
    transition: var(--transition);
}

.modal .form-control:focus,
.modal .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* Button styling matching site theme */
.modal .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 0.875rem;
}

.modal .btn-primary:hover:not(:disabled) {
    background: #5a67d8;
    border-color: #5a67d8;
    transform: translateY(-1px);
}

.modal .btn-primary:disabled {
    opacity: 0.6;
    transform: none;
}

.modal .btn-outline-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

.modal .btn-outline-secondary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.modal .btn-outline-info {
    border-color: var(--info-color);
    color: var(--info-color);
    background: transparent;
}

.modal .btn-outline-info:hover {
    background: var(--info-color);
    border-color: var(--info-color);
    color: white;
}

/* Status badge matching site theme */
.modal .status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Error and success messages matching site theme */
.modal .text-danger {
    color: var(--danger-color);
    font-size: 0.875rem;
    font-weight: 500;
}

.modal .text-success {
    color: var(--success-color);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Responsive modal */
@media (max-width: 992px) {
    .modal-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .modal-dialog.modal-lg {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    .modal-info-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}
