/* Enhanced animations and styling for MediFlow */
:root {
    --primary: #0463FA;
    --light: #EFF5FF;
    --dark: #1B2C51;
}

/* Floating particles animation */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) { width: 10px; height: 10px; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 15px; height: 15px; left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { width: 8px; height: 8px; left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { width: 12px; height: 12px; left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { width: 6px; height: 6px; left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { width: 14px; height: 14px; left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { width: 9px; height: 9px; left: 70%; animation-delay: 0.5s; }
.particle:nth-child(8) { width: 11px; height: 11px; left: 80%; animation-delay: 1.5s; }
.particle:nth-child(9) { width: 7px; height: 7px; left: 90%; animation-delay: 2.5s; }

@keyframes float {
    0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Hero Section with animated background */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #0856d6 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="white" opacity="0.1"><polygon points="0,0 1000,0 1000,100 0,80"/></svg>');
    background-size: cover;
    animation: wave 3s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-50px); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    animation: fadeInUp 1s ease-out;
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: slideInLeft 1s ease-out 0.3s both;
}

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

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.9;
    animation: slideInRight 1s ease-out 0.6s both;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.hero-feature {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    animation: bounceIn 1s ease-out;
    animation-fill-mode: both;
}

.hero-feature:nth-child(1) { animation-delay: 0.9s; }
.hero-feature:nth-child(2) { animation-delay: 1.2s; }
.hero-feature:nth-child(3) { animation-delay: 1.5s; }

.hero-feature,
.hero-feature h3,
.hero-feature i {
    color: #fff !important;
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.hero-feature:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.hero-feature i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* Medical icons floating animation */
.medical-icon {
    position: absolute;
    color: rgba(255,255,255,0.1);
    font-size: 3rem;
    animation: floatMedical 4s ease-in-out infinite;
}

.medical-icon:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.medical-icon:nth-child(2) { top: 60%; right: 15%; animation-delay: 1s; }
.medical-icon:nth-child(3) { bottom: 30%; left: 20%; animation-delay: 2s; }
.medical-icon:nth-child(4) { top: 40%; right: 25%; animation-delay: 3s; }

@keyframes floatMedical {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Section animations */
.section {
    padding: 80px 0;
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.section.animate {
    opacity: 1;
    transform: translateY(0);
}

.section:nth-child(even) {
    background: var(--light);
}

/* Animated wave dividers */
.wave-divider {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 50px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" fill="%23EFF5FF"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25"/><path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5"/><path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z"/></svg>') no-repeat;
    background-size: cover;
    animation: waveMove 3s ease-in-out infinite;
}

@keyframes waveMove {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}

/* Feature cards with staggered animations */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(4, 99, 250, 0.1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #0856d6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(4, 99, 250, 0.2);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
    display: block;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Image styling */
.image-container {
    text-align: center;
    margin: 40px 0;
    position: relative;
}

.section-image {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    animation: imageFloat 3s ease-in-out infinite;
}

.section-image:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(4, 99, 250, 0.2);
}

@keyframes imageFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Video styling */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.video-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.video-container:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(4, 99, 250, 0.2);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    margin: 20px 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.video-container h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
}

.video-container p {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin-top: 15px;
}

/* PCB Design Section */
.pcb-content {
    max-width: 1000px;
    margin: 0 auto;
}

.pcb-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.pcb-feature {
    background: white;
    padding: 30px 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary);
}

.pcb-feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(4, 99, 250, 0.2);
}

.pcb-feature i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: block;
}

.pcb-feature h4 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.pcb-feature p {
    color: #666;
    font-size: 0.95rem;
}


.pcb-image-placeholder {
    background: linear-gradient(135deg, var(--light), #d4edda);
    border-radius: 15px;
    padding: 60px 30px;
    text-align: center;
    color: var(--primary);
    border: 2px dashed var(--primary);
    margin: 30px 0;
    transition: all 0.3s ease;
}

.pcb-image-placeholder:hover {
    background: linear-gradient(135deg, #d4edda, var(--light));
    transform: scale(1.02);
}

.pcb-image-placeholder i {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.pcb-image-placeholder p {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.pcb-image-placeholder small {
    font-size: 1rem;
    opacity: 0.7;
}

/* About section styling */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
}

.highlight-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.highlight-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.highlight-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(4, 99, 250, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.highlight-box:hover::before {
    animation: shimmer 0.8s ease-in-out;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}

.highlight-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(4, 99, 250, 0.2);
}

.highlight-box i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: block;
}

.highlight-box h4 {
    color: var(--primary);
    margin-bottom: 10px;
}

/* CTA Button with pulse animation */
.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), #0856d6);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(4, 99, 250, 0.3);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(4, 99, 250, 0.4);
}

/* Testing section with animated list */
.testing-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.testing-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
    position: relative;
}

.testing-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(to bottom, var(--primary), #0856d6);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.testing-item:hover::after {
    transform: scaleY(1);
}

.testing-item:hover {
    transform: translateX(5px);
    box-shadow: 0 10px 25px rgba(4, 99, 250, 0.2);
}

.testing-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
    display: block;
}

/* Scroll-triggered animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.fade-in-up.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-features {
        flex-direction: column;
        gap: 20px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .video-container {
        padding: 20px;
    }
    
    .pcb-features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .section-image {
        margin: 20px 0;
    }
}

/* Video Background Styling - CORRECTED */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0; 
    overflow: hidden;
    pointer-events: none; 
}

.video-background video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: brightness(1) contrast(1.1);
}

/* Lighter Video Overlay */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(4, 99, 250, 0.4), rgba(8, 86, 214, 0.3)); /* Reduced opacity */
    z-index: -1; 
}

/* Hero Section*/
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #0856d6 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* Content appears above everything */
.hero-content {
    position: relative;
    z-index: 10; 
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    animation: fadeInUp 1s ease-out;
}

/* Particles above video but below content */
/* Particle Container */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 7; 
}

/* Enhanced Individual Particles */
.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5); 
    backdrop-filter: blur(1px);
}

/* Varied Particle Sizes for Dynamic Effect */
.particle:nth-child(1) { width: 15px; height: 15px; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 20px; height: 20px; left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { width: 12px; height: 12px; left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { width: 18px; height: 18px; left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { width: 10px; height: 10px; left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { width: 22px; height: 22px; left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { width: 14px; height: 14px; left: 70%; animation-delay: 0.5s; }
.particle:nth-child(8) { width: 16px; height: 16px; left: 80%; animation-delay: 1.5s; }
.particle:nth-child(9) { width: 13px; height: 13px; left: 90%; animation-delay: 2.5s; }

/* Enhanced Floating Animation */
@keyframes float {
    0%, 100% { 
        transform: translateY(100vh) rotate(0deg); 
        opacity: 0; 
    }
    10% { 
        opacity: 0.8; 
    }
    50% { 
        opacity: 1; 
    }
    90% { 
        opacity: 0.8; 
    }
    100% { 
        transform: translateY(-100px) rotate(360deg); 
        opacity: 0; 
    }
}

/* Medical icons positioning and animation */
.medical-icon {
    position: absolute;
    color: rgba(255,255,255,0.6);
    font-size: 4rem;
    animation: floatMedical 4s ease-in-out infinite;
    z-index: 2;
    text-shadow: 0 0 20px rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

/* Individual icon positioning using nth-child */
.medical-icon:nth-of-type(1) { /* heartbeat icon */
    top: 25%; 
    left: 8%; 
    animation-delay: 0s;
}

.medical-icon:nth-of-type(2) { /* pills icon */
    top: 65%; 
    right: 12%; 
    animation-delay: 1s;
}

.medical-icon:nth-of-type(3) { /* user-md icon */
    bottom: 35%; 
    left: 18%; 
    animation-delay: 2s;
}

.medical-icon:nth-of-type(4) { /* hospital icon */
    top: 25%; 
    right: 18%; 
    animation-delay: 3s;
}

/* Floating animation keyframes */
@keyframes floatMedical {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(5deg); 
    }
}


/* Mobile Optimization */
@media (max-width: 768px) {
    .video-background video {
        opacity: 0.3; 
    }
    
    .video-overlay {
        background: linear-gradient(135deg, rgba(4, 99, 250, 0.5), rgba(8, 86, 214, 0.4));
    }
}

/* Fallback for browsers that don't support video */
@supports not (object-fit: cover) {
    .video-background {
        background: linear-gradient(135deg, var(--primary) 0%, #0856d6 100%);
    }
    
    .video-background video {
        display: none;
    }
}



/* Pulsing glow animation */
.hero-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 20px;
    color: #ffffff;
    text-align: center;
    animation: slideInLeft 1s ease-out 0.3s both;

    /* 3D layered shadows */
    text-shadow:
        1px 1px 0 #0f52ba,
        2px 2px 0 #0f52ba,
        3px 3px 0 #0a3d91;
}



