/* Basic Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007bff; /* BioBot Blue */
    --secondary-color: #343a40; /* Dark Grey for contrast */
    --accent-color: #28a745; /* Green for success/highlight */
    --text-light: #f4f4f4;
    --text-dark: #333;
    --bg-light: #fff;
    --bg-dark: #212529;
    --card-bg: #fff;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden; /* Prevent horizontal scroll due to animations */
}

/* Global Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100; /* Above animation */
    padding: 20px 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0)); /* Gradient for subtle header */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: var(--text-light);
    font-size: 1.8em;
    margin: 0;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

header nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: var(--primary-color);
}

/* CTA Button */
.cta-button {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.hero-cta {
    font-size: 1.2em;
    padding: 15px 30px;
    margin-top: 30px;
}

/* Animation & Overlay */
.animation-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-dark); /* Fallback/background for canvas */
}

#biobotCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    z-index: 1;
}

.overlay-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10; /* Above canvas, below header */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center hero content */
    align-items: center;
    text-align: center;
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.4); /* Dark overlay for readability */
}

.hero-section {
    flex-grow: 1; /* Pushes header to top, content to center */
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%; /* Ensure it takes full width for container padding */
}

.hero-section h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-section .tagline {
    font-size: 1.5em;
    margin-bottom: 40px;
}

/* Content Sections */
.section {
    padding: 80px 0;
    text-align: center;
}

.section:nth-of-type(odd) {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.section:nth-of-type(even) {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

.section h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: inherit; /* Inherit from section for dark/light contrast */
}

.section p {
    font-size: 1.1em;
    max-width: 900px;
    margin: 0 auto 50px auto;
    line-height: 1.6;
    color: inherit;
}

.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
}

.feature-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 30px;
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-dark); /* Ensure text is dark on light cards */
}

.bg-dark .feature-card {
    background: rgba(255, 255, 255, 0.08); /* Lighter card on dark background */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: var(--text-light); /* Light text on dark cards */
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.bg-dark .feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

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

.feature-card p {
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0;
    color: inherit; /* Inherit from card */
}

.section-cta {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.section-cta:hover {
    color: #0056b3;
}

.bg-dark .section-cta {
    color: var(--accent-color); /* Different accent for dark sections */
}
.bg-dark .section-cta:hover {
    color: #218838;
}

/* Footer */
footer {
    background-color: #1a1a1a;
    color: #bbb;
    text-align: center;
    padding: 30px 0;
    font-size: 0.9em;
}

/* Contact Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Above everything */
    visibility: hidden; /* Hidden by default */
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.popup-overlay.show {
    visibility: visible;
    opacity: 1;
}

.popup-content {
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 40px;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-overlay.show .popup-content {
    transform: scale(1);
}

.popup-content h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.popup-content p {
    margin-bottom: 25px;
    font-size: 1.1em;
    line-height: 1.5;
}

.popup-content .small-text {
    font-size: 0.85em;
    color: #777;
    margin-top: 20px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #333;
}

.btn-email {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-email:hover {
    background-color: #218838;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .cta-button {
        display: none; /* Hide desktop button on smaller screens */
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    header nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-section h1 {
        font-size: 2.5em;
    }

    .hero-section .tagline {
        font-size: 1.2em;
    }

    .section h2 {
        font-size: 2em;
    }

    .features {
        flex-direction: column;
        align-items: center;
    }

    .feature-card {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 2em;
    }

    .hero-section .tagline {
        font-size: 1em;
    }

    .cta-button.hero-cta {
        padding: 12px 25px;
        font-size: 1em;
    }

    .popup-content {
        padding: 30px 20px;
    }

    .popup-content h2 {
        font-size: 1.8em;
    }

    .btn-email {
        padding: 12px 20px;
        font-size: 1em;
    }
}
