/* Custom CSS for Biohaven Medical Laboratory */

/* Font Configuration */
body {
    font-family: 'Inter', sans-serif;
}

/* Custom Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes float-delay {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-30px); }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes scroll {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(10px); opacity: 0.5; }
    100% { transform: translateY(0); opacity: 1; }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delay {
    animation: float-delay 8s ease-in-out infinite;
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

.animate-scroll {
    animation: scroll 2s ease-in-out infinite;
}

/* Sticky Navigation Styles */
#navbar {
    position: fixed !important;
    width: 100% !important;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 50;
}

/* Default state - transparent background with white text */
#navbar:not(.scrolled) {
    background: transparent;
}

#navbar:not(.scrolled) .text-white,
#navbar:not(.scrolled) .text-xl {
    color: white !important;
}

#navbar:not(.scrolled) .text-red-500 {
    color: #ef4444 !important;
}

/* Scrolled state - white background with dark text */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
}

#navbar.scrolled .text-white,
#navbar.scrolled .text-xl {
    color: #1E3A8A !important;
}

#navbar.scrolled .text-red-500 {
    color: #ef4444 !important;
}

#navbar.scrolled .text-white:hover {
    color: #2563EB !important;
}

/* Ensure brand name transitions smoothly */
#navbar .text-xl {
    transition: color 0.3s ease;
}

/* Service Card Hover Effects */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.service-card:hover::before {
    left: 100%;
}

/* Form Input Animations */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-group input:focus + label,
.form-group textarea:focus + label {
    color: #1E3A8A;
}

/* Testimonial Carousel */
.testimonial-carousel {
    overflow: visible;
}

/* Scroll Progress Bar */
#progress-bar {
    background: linear-gradient(90deg, #1E3A8A, #2563EB, #3B82F6);
}

/* Preloader */
#preloader {
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #1E3A8A;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563EB;
}

/* Glassmorphism Effects */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Counter Animation */
.counter {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* Success Modal Animation */
#success-modal.show .bg-white {
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* FAQ Accordion */
.faq-question.active i {
    transform: rotate(180deg);
}

.faq-answer {
    transition: all 0.3s ease-in-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Ensure containers don't overflow */
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        box-sizing: border-box;
    }
    
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    /* Fix hero section */
    #home {
        padding-top: 80px;
        min-height: 100vh;
    }
    
    /* Fix grid layouts for mobile */
    .grid {
        gap: 1rem;
    }
    
    .lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .lg\\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .md\\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    /* Fix service cards */
    .service-card {
        margin: 0 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    /* Fix form elements */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix mobile menu */
    #mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 49;
        box-sizing: border-box;
    }
    
    /* Fix floating buttons */
    .fixed.bottom-8.right-8 {
        right: 1rem;
        bottom: 1rem;
    }
    
    .fixed.bottom-8.left-8 {
        left: 1rem;
        bottom: 1rem;
    }
    
    /* Fix dark mode toggle */
    .dark-mode-toggle {
        right: 1rem;
        bottom: 5rem;
    }
    
    /* Fix testimonials carousel */
    .testimonial-carousel {
        padding: 0 1rem;
    }
    
    /* Fix modal */
    #success-modal .bg-white {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    /* Fix text overflow */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix buttons */
    button, a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Fix padding and margins */
    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .px-6 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .px-8 {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .p-8 {
        padding: 2rem;
    }
    
    .p-12 {
        padding: 3rem;
    }
}

/* Accessibility - Focus States */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #1E3A8A;
    outline-offset: 2px;
}

/* Dark Mode Toggle (Bonus Feature) */
.dark-mode-toggle {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 40;
}

/* Dark Mode Styles */
body.dark {
    background-color: #1a1a1a;
    color: #ffffff;
}

body.dark .bg-white {
    background-color: #2d2d2d !important;
}

body.dark .bg-gray-50 {
    background-color: #2d2d2d !important;
}

body.dark .bg-gray-100 {
    background-color: #3d3d3d !important;
}

body.dark .text-gray-800 {
    color: #ffffff !important;
}

body.dark .text-gray-600 {
    color: #b0b0b0 !important;
}

body.dark .text-gray-700 {
    color: #e0e0e0 !important;
}

body.dark .border-gray-200 {
    border-color: #4d4d4d !important;
}

body.dark .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}

body.dark .shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

/* Dark mode for form elements */
body.dark input,
body.dark select,
body.dark textarea {
    background-color: #3d3d3d !important;
    color: #ffffff !important;
    border-color: #4d4d4d !important;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
    color: #b0b0b0 !important;
}

/* Dark mode for navbar */
body.dark #navbar.scrolled {
    background-color: rgba(45, 45, 45, 0.95) !important;
}

body.dark #navbar.scrolled .text-white,
body.dark #navbar.scrolled .text-xl {
    color: #ffffff !important;
}

/* Dark mode for service cards */
body.dark .service-card {
    background-color: #2d2d2d !important;
}

/* Dark mode for testimonials */
body.dark .testimonial-carousel .bg-gray-50 {
    background-color: #2d2d2d !important;
}

/* Dark mode for footer */
body.dark footer {
    background-color: #0d0d0d !important;
}

/* Dark mode for modal */
body.dark #success-modal .bg-white {
    background-color: #2d2d2d !important;
}

body.dark #success-modal .text-gray-800 {
    color: #ffffff !important;
}

body.dark #success-modal .text-gray-600 {
    color: #b0b0b0 !important;
}

/* Blog Card Styles */
.blog-card {
    transition: transform 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
}

/* Patient Portal Login UI */
.portal-preview {
    background: linear-gradient(135deg, #1E3A8A, #2563EB);
    padding: 2px;
    border-radius: 20px;
}

.portal-preview-content {
    background: white;
    border-radius: 18px;
    padding: 20px;
}

/* Result Tracking UI */
.result-tracking {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Loading State for Forms */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #1E3A8A;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}