/*
Medify AI Website Stylesheet

Color Palette:
Primary Blue: #4A71D4
Primary Purple: #6A49B8
Accent Dark Blue/Indigo: #1E2A38 (for text, headings, icons)
Neutral White: #FFFFFF
Background Cream/Off-White: #F5F5F1 (for main page background)
Supporting Light Grey: #E0E0E0 (for dividers, subtle UI)

Typography:
Headings: 'Montserrat', sans-serif
Body: 'Open Sans', sans-serif
*/

:root {
    --primary-blue: #4A71D4;
    --primary-blue-rgb: 74, 113, 212;
    --primary-purple: #6A49B8;
    --accent-dark-blue: #1E2A38;
    --neutral-white: #FFFFFF;
    --background-cream: #F5F5F1;
    --supporting-light-grey: #E0E0E0;
    --text-color-dark: #333333;
    --text-color-light: var(--neutral-white);
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Open Sans', sans-serif;
    --header-height: 90px;
    --primary-dark-bg: #0B0C21;
    --header-bg-dark: #101128;
}

/* Global Resets and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size */
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    color: var(--text-color-light);
    background-color: var(--primary-dark-bg);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-blue);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-purple);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-padding {
    padding: 80px 0;
}

.alt-bg {
    background-color: var(--neutral-white);
}

.section-title {
    font-family: var(--heading-font);
    font-size: 2.5rem; /* 40px */
    color: var(--neutral-white);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
}

.section-subtitle {
    font-size: 1.125rem; /* 18px */
    text-align: center;
    color: var(--supporting-light-grey);
    margin-bottom: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--neutral-white);
}

.btn-primary:hover {
    background-color: var(--primary-purple);
    color: var(--neutral-white);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--neutral-white);
    border-color: var(--neutral-white);
}

.btn-secondary:hover {
    background-color: var(--neutral-white);
    color: var(--primary-dark-bg);
    transform: translateY(-2px);
}

/* Header */
header {
    background-color: transparent; /* Transparent initially */
    box-shadow: none; /* Remove shadow when transparent initially */
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    height: var(--header-height);
    transition: background-color 0.3s ease, box-shadow 0.3s ease; /* For smooth transition on scroll */
}

header.scrolled {
    background-color: var(--primary-dark-bg); /* Solid background on scroll - Updated to primary-dark-bg */
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Override default container padding for the header's navigation */
header nav.container {
    padding-left: 5px;
    padding-right: 5px;
}

/* Override default container padding for the header's navigation */
header nav.container {
    width: calc(100% - 30px); /* Span full width minus 5px margin on each side */
    margin-left: -10px;
    margin-top: 0; /* Ensure no auto vertical margin */
    margin-bottom: 0; /* Ensure no auto vertical margin */
    padding-left: 0; /* Content within can use full width */
    padding-right: 0; /* Content within can use full width */
    max-width: none; /* Override max-width from general .container if needed for full span */
}

header .logo img {
    height: 125px; /* Increased from 50px */
    width: auto;
}

header nav ul {
    display: flex;
}

header nav ul li {
    margin-left: 30px;
}

header nav ul li a {
    font-family: var(--heading-font);
    color: var(--neutral-white); /* White nav links for better contrast on video */
    font-weight: 600;
    padding: 5px 0;
    position: relative;
    text-shadow: 0 0 5px rgba(0,0,0,0.3); /* Subtle text shadow for readability */
}

header nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-purple);
    transition: width 0.3s ease;
}

header nav ul li a:hover::after,
header nav ul li a.active::after {
    width: 100%;
    background-color: var(--primary-purple);
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column; /* Stack content vertically */
    align-items: center; /* Center content horizontally */
    justify-content: flex-end; /* Push content (buttons) to the bottom */
    text-align: center;
    color: var(--neutral-white);
    padding-top: var(--header-height); /* Offset for fixed header */
    padding-bottom: 80px; /* Add space below the buttons */
}

.hero-video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    background-color: var(--accent-dark-blue);
}

.hero-video-background video,
.hero-video-background img.hero-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center; /* Align video to the left */
    transform: scale(1.15); /* Zoom in slightly to hide borders */
}

.hero-video-background::after { /* Dark overlay for text readability */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 42, 56, 0); /* Dark Blue/Indigo with 0% opacity */
}

.hero-content {
    position: relative; /* To be above the overlay */
    z-index: 1;
}

.hero-content h1,
.hero-content p {
    display: none; /* Hide the h1 and p elements */
}

.hero-cta-buttons .btn {
    margin: 0 10px;
}

.hero-cta-buttons .btn-primary {
    background-color: var(--primary-blue);
    color: var(--neutral-white);
}
.hero-cta-buttons .btn-primary:hover {
    background-color: var(--primary-purple);
}

.hero-cta-buttons .btn-secondary {
    background-color: transparent;
    color: var(--neutral-white);
    border-color: var(--neutral-white);
}
.hero-cta-buttons .btn-secondary:hover {
    background-color: var(--neutral-white);
    color: var(--accent-dark-blue);
}

/* Problem Section */
.problem-section .problem-content p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto 20px auto;
    text-align: center;
    color: var(--supporting-light-grey);
}

.problem-section .problem-content img.spot-illustration {
    margin-top: 30px;
    border-radius: 8px;
    width: 100%; /* Make width a percentage to scale */
    max-width: none; /* Remove max-width to allow scaling */
    margin-left: auto;
    margin-right: auto;
}

/* Solutions Section */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.solution-card {
    background-color: var(--neutral-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.solution-card:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 25px rgba(30, 42, 56, 0.15);
}

.solution-icon img {
    height: 60px;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.3s ease;
}

.solution-card:hover .solution-icon img {
    transform: scale(1.1);
}

.solution-card h3 {
    font-family: var(--heading-font);
    font-size: 1.5rem; /* 24px */
    color: var(--accent-dark-blue);
    margin-bottom: 10px;
}

.solution-card p {
    font-size: 0.95rem;
    color: #555;
}

/* Benefits Section */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 30px;
}

.benefit-item {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(var(--primary-blue-rgb, 74, 113, 212), 0.15);
}

.benefit-icon img {
    height: 50px;
    margin-bottom: 15px;
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.3s ease;
}

.benefit-item:hover .benefit-icon img {
    transform: scale(1.1);
}

.benefit-item h4 {
    font-family: var(--heading-font);
    font-size: 1.3rem; /* 21px */
    color: var(--neutral-white);
    margin-bottom: 10px;
}

.benefit-item p {
    font-size: 0.95rem;
    color: var(--supporting-light-grey);
}

/* Technology Section */
.technology-section {
    position: relative; /* Ensure this is set for absolute positioning of the image */
    padding-bottom: 250px; /* Placeholder: Adjust based on image height or make dynamic */
    /* Any previous background-image or ::before overlay styles for .technology-section are removed/reverted */
}

/* Remove styles for the previously added structured divs */
.technology-header-content,
.technology-image-background-content,
.technology-image-background-content::before {
    background: none; /* Remove any background */
    padding: 0; /* Reset padding */
    /* Reset any other specific styles if they were added */
}

/* Ensure text colors in technology section are appropriate for dark theme */
.technology-section .section-title,
.technology-section h2 { /* Catchall for h2 if used */
    color: var(--text-color-dark);
}

.technology-section .section-subtitle {
    color: var(--text-color-dark);
}

.technology-section .technology-content p {
    color: var(--text-color-dark);
    font-size: 1.1rem;
    max-width: 800px; /* Retain similar text styling */
    margin: 0 auto 30px auto; /* Retain similar text styling */
    text-align: center; /* Retain similar text styling */
}

.tech-section-image {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 88%; /* Adjust as needed */
    max-width: 750px; /* Adjust as needed */
    height: auto; /* Maintain aspect ratio */
    z-index: 0; /* Ensure it's behind text content if overlap occurs */
}

/* Ensure the container within technology section is above the absolute image if needed */
.technology-section .container {
    position: relative; 
    z-index: 2; 
}

.technology-section .technology-content { 
    text-align: center; 
}

.tech-illustration {
    max-width: 400px;
    margin: 20px auto 0 auto;
}

/* About Us Section (on primary dark background) */
.about-section {
    position: relative; /* Needed for the overlay */
    background-image: url('../assets/images/south_africa_map_side.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.about-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(11, 12, 33, 0.7); /* var(--primary-dark-bg) with 70% opacity */
    z-index: 1; /* Overlay should be above the background image but below the content */
}

.about-section .container {
    position: relative; /* Ensure content is above the overlay */
    z-index: 2;
}

.about-section .about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
}

.about-section .about-text {
    flex: 1;
    min-width: 300px;
}

.about-section .about-text p {
    margin-bottom: 15px;
    font-size: 1.05rem;
    color: var(--supporting-light-grey);
}

.about-section .about-image {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.about-section .about-image img {
    max-width: 450px;
    border-radius: 8px;
}

/* Contact Section */
.contact-form {
    max-width: 700px;
    margin: 0 auto 40px auto;
    background-color: var(--neutral-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.contact-section.alt-bg .contact-form {
     background-color: #fdfdfb; /* Slightly different from main cream for depth */
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: var(--heading-font);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--accent-dark-blue);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--supporting-light-grey);
    border-radius: 5px;
    font-family: var(--body-font);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(74, 113, 212, 0.2);
}

.contact-form button[type="submit"] {
    width: 100%;
    padding: 15px;
}

#formStatus {
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
}

.contact-details {
    text-align: center;
    margin-top: 30px;
}

.contact-details p {
    margin-bottom: 10px;
    font-size: 1.05rem;
}

/* Footer */
footer {
    background-color: var(--primary-dark-bg); /* Match primary-dark-bg */
    color: var(--neutral-white);
    padding: 40px 0 20px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.footer-logo img {
    height: 125px; /* Adjust as needed */
}

.footer-links a {
    color: var(--supporting-light-grey); /* Light color for footer links */
    margin: 0 10px;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-blue);
}

.footer-social a {
    margin: 0 8px;
}

.footer-social img {
    height: 24px;
    width: 24px;
    filter: brightness(0) invert(1) opacity(0.8);
    transition: filter 0.3s ease;
}

.footer-social img:hover {
    filter: brightness(0) invert(1) opacity(1);
}

.copyright p {
    font-size: 0.85rem;
    color: #ccc;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 20px;
}

/* Animations and Transitions (Subtle) */
.section-title,
.section-subtitle,
.hero-content h1,
.hero-content p,
.solution-card,
.benefit-item,
.about-text,
.about-image {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* To be triggered by JS on scroll */
.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 992px) {
    .section-title {
        font-size: 2.2rem;
    }
    .hero-content h1 {
        font-size: 2.8rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    .section-title {
        font-size: 2rem;
    }

    /* Adjust hero section for mobile - use flexbox for stacking */
    #hero {
        height: 100vh; /* Span full viewport height */
        display: flex; /* Use flexbox */
        flex-direction: column; /* Stack children vertically */
        align-items: center; /* Center content horizontally */
        justify-content: flex-end; /* Push content (buttons) to the bottom */
        text-align: center; /* Ensure text within is centered */
        position: relative; /* For absolute positioning of background */
        overflow: hidden; /* Prevent scrollbars if background is slightly larger */
    }

    /* Adjust hero video background for mobile */
    .hero-video-background {
        position: absolute; /* Position absolutely to fill #hero */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%; /* Fill parent #hero */
        overflow: hidden;
        z-index: -1; /* Behind other content in #hero */
        background-color: var(--accent-dark-blue); /* Fallback color */
    }

    /* Hide video and show fallback image on mobile */
    .hero-video-background video {
        display: none;
    }
    .hero-video-background img.hero-background-image {
        display: block !important; /* Ensure it overrides inline style */
        object-fit: cover; /* Cover the area */
        width: 100%; /* Full width of its parent */
        height: 100%; /* Full height of its parent */
        transform: none; /* Remove scaling */
    }

    /* Style and position hero content (buttons) below the image */
    .hero-content {
        position: relative; /* Stays in flex flow, allows z-index */
        text-align: center;
        z-index: 1; /* Above the background */
        width: 90%; /* Use percentage for better responsiveness */
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
        padding-bottom: 40px; /* Space from the bottom edge for buttons */
    }

    /* Hide the h1 and p elements on mobile */
    .hero-content h1,
    .hero-content p {
        display: none; /* Hide the h1 and p elements */
    }

    .section-subtitle {
        margin-bottom: 30px;
    }
    .section-padding {
        padding: 60px 0;
    }
    header nav ul {
        display: none; /* Simple mobile menu can be added with JS */
    }

    .hero-content .hero-cta-buttons .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin-bottom: 10px; /* Add margin between stacked buttons */
    }
    .hero-content .hero-cta-buttons {
        display: flex;
        flex-direction: column; /* Stack buttons vertically */
        align-items: center;
    }

    /* Restore other mobile styles */
    .solutions-grid {
        grid-template-columns: 1fr; /* Stack on smaller screens */
    }
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    .about-section .about-content {
        flex-direction: column;
    }
    .about-section .about-text,
    .about-section .about-image {
        flex: none;
        width: 100%;
    }
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.8rem;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
     .hero-content p {
        font-size: 0.9rem;
    }
}

/* Text on .alt-bg sections needs to be dark */
.alt-bg .section-title,
.alt-bg h2,
.alt-bg h3,
.alt-bg h4 {
    color: var(--text-color-dark);
}

/* Add margin above h3 within privacy content */
.privacy-content h3 {
    margin-top: 25px; /* Adjust value as needed */
}

.alt-bg .section-subtitle,
.alt-bg p,
.alt-bg .form-group label,
.alt-bg .contact-details p,
.alt-bg .contact-details a {
    color: var(--text-color-dark);
}
.alt-bg .contact-details a:hover {
    color: var(--primary-purple);
}

/* Ensure buttons in .alt-bg sections have dark text/border if secondary */
.alt-bg .btn-secondary {
    color: var(--accent-dark-blue);
    border-color: var(--accent-dark-blue);
}

.alt-bg .btn-secondary:hover {
    background-color: var(--accent-dark-blue);
    color: var(--neutral-white);
} 