/* ===== CONTACT MODAL STYLES ===== */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.contact-modal[style*="flex"] {
    opacity: 1;
    visibility: visible;
}

.contact-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.contact-modal-content {
    position: relative;
    background: linear-gradient(135deg, #fefefe 0%, #f8fafc 25%, #f1f5f9 50%, #e2e8f0 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 2px solid rgba(14, 165, 233, 0.2);
}

.contact-modal[style*="flex"] .contact-modal-content {
    transform: scale(1);
}

.contact-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.2);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05), rgba(56, 189, 248, 0.02));
}

.contact-modal-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: #475569;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-modal-close:hover {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    transform: scale(1.1);
}

.contact-modal-close:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

.contact-modal-body {
    padding: 0;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    color: #475569;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(14, 165, 233, 0.2);
    border-left: 4px solid #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    margin: 0;
    font-size: 1rem;
    color: #64748b;
}

/* ===== MICROSOFT FORM CONTAINER ===== */
.microsoft-form-container {
    min-height: 400px;
    background: transparent;
}

.microsoft-form-container iframe {
    border-radius: 0 0 16px 16px;
    width: 100% !important;
    min-height: 480px;
}

/* Support for both modal and page containers */
#microsoft-form-container-modal {
    min-height: 400px;
    background: transparent;
}

#microsoft-form-container-modal iframe {
    border-radius: 0 0 16px 16px;
    width: 100% !important;
    min-height: 480px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .contact-modal-content {
        width: 95vw;
        max-height: 95vh;
        margin: 20px;
    }
    
    .contact-modal-header {
        padding: 20px;
    }
    
    .contact-modal-header h2 {
        font-size: 1.5rem;
    }
    
    .contact-modal-body {
        max-height: calc(95vh - 80px);
    }
    
    .loading-spinner {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .contact-modal-content {
        width: 98vw;
        max-height: 98vh;
        margin: 10px;
        border-radius: 12px;
    }
    
    .contact-modal-header {
        padding: 16px;
    }
    
    .contact-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .contact-modal-body {
        max-height: calc(98vh - 70px);
    }
    
    .loading-spinner {
        padding: 30px 15px;
    }
    
    .spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    .contact-modal,
    .contact-modal-content,
    .contact-modal-close,
    .spinner {
        transition: none;
        animation: none;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .contact-modal-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .contact-modal-content {
        border: 3px solid #0ea5e9;
    }
    
    .contact-modal-header {
        border-bottom: 2px solid #0ea5e9;
    }
    
    .contact-modal-close {
        border: 2px solid #475569;
    }
    
    .contact-modal-close:hover {
        border-color: #0ea5e9;
        background: #0ea5e9;
        color: white;
    }
}

/* ===== FOCUS MANAGEMENT ===== */
.contact-modal-content:focus-within {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(14, 165, 233, 0.3);
}

/* ===== SMOOTH SCROLLING ===== */
.contact-modal-body {
    scroll-behavior: smooth;
}

.contact-modal-body::-webkit-scrollbar {
    width: 8px;
}

.contact-modal-body::-webkit-scrollbar-track {
    background: rgba(14, 165, 233, 0.1);
    border-radius: 4px;
}

.contact-modal-body::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.3);
    border-radius: 4px;
}

.contact-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.5);
}

/* ===== ANIMATION ENHANCEMENTS ===== */
.contact-modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    0% {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ===== TROPICAL THEME INTEGRATION ===== */
.contact-modal-header {
    background: linear-gradient(135deg, 
        rgba(14, 165, 233, 0.08) 0%, 
        rgba(56, 189, 248, 0.04) 25%, 
        rgba(16, 185, 129, 0.04) 50%, 
        rgba(249, 115, 22, 0.04) 75%, 
        rgba(251, 191, 36, 0.04) 100%);
}

.contact-modal-close:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(56, 189, 248, 0.05));
}
