/*=====================================
  1. Base & Variables - HIGH CONTRAST
=======================================*/
:root {
    /* Color Palette */
    --color-dark-bg: #121223;     /* Midnight Blue/Dark Gray */
    --color-primary-glow: #E74C3C; /* Bright Red (Heart, Accent) */
    --color-secondary-blue: #3498DB; /* Electric Blue (ECG, Veins) */
    --color-text-light: #E0E0E0;   /* Light Text */
    --color-text-subtle: #8888AA;  /* Subdued Text */
    --color-mid-dark: #1A1A2E;     /* Slightly lighter dark section */

    /* Spacing & Transitions */
    --padding-section: 80px 0;
    --container-width: 1100px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--color-dark-bg);
    color: var(--color-text-light);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: var(--padding-section);
    background-color: var(--color-dark-bg);
}

section:nth-child(even) {
    background-color: var(--color-mid-dark);
}

.section-title {
    font-size: 2.2rem;
    color: var(--color-primary-glow);
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

/* AOS Setup (Animate on Scroll) */
.aos-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    transition-delay: var(--aos-delay, 0s);
}

.aos-item[data-aos="fade-in"] {
    transform: none;
}
.aos-item[data-aos="slide-right"] {
    transform: translateX(-50px);
}
.aos-item[data-aos="zoom-in"] {
    transform: scale(0.9);
}

.aos-item.animated {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}


/*=====================================
  2. Navigation & Header
=======================================*/
header {
    background-color: var(--color-dark-bg);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.secondary-btn {
    background-color: var(--color-secondary-blue);
    color: var(--color-dark-bg);
    border: 2px solid var(--color-secondary-blue);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.secondary-btn:hover {
    background-color: transparent;
    color: var(--color-secondary-blue);
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--color-secondary-blue);
}

/* .logo {
    font-size: 1.5rem;
    color: var(--color-primary-glow);
} */
.logo {
    font-size: 1.5rem; /* Still good fallback */
    color: var(--color-primary-glow);
    /* NEW: Ensures the image centers itself within the h1 area */
    display: flex; 
    align-items: center;
}
.header-logo {
    /* Set max height for the logo to keep the header clean and balanced */
    height: 80px; 
    width: auto;
    transition: transform var(--transition-speed);
}
.header-logo:hover {
    transform: scale(1.05); /* Optional: subtle hover effect */
}
nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: var(--color-dark-bg);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
}

nav.active {
    display: flex;
}

nav a {
    text-decoration: none;
    color: var(--color-text-light);
    padding: 15px 20px;
    text-align: center;
    transition: background-color var(--transition-speed);
}

nav a:hover {
    background-color: var(--color-mid-dark);
    color: var(--color-secondary-blue);
}

/*=====================================
  11. Social Media Icon Styling (Updated)
=======================================*/

.social-links {
    margin: 20px 0; /* Vertical spacing */
    display: flex;
    gap: 25px; /* Increased spacing between icons for clarity */
    justify-content: flex-start; 
}

.social-links a {
    color: var(--color-text-subtle);
    font-size: 1.8rem; /* Slightly larger icon size */
    text-decoration: none;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.social-links a:hover {
    color: var(--color-secondary-blue); /* Highlights in blue on hover */
    transform: translateY(-3px); /* Subtle lift effect */
}

/* Styles specific to the prominent icons at the top of the contact card */
.contact-header-social {
    justify-content: center; /* Center the icons within the contact card */
    padding-bottom: 20px;
    margin-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle separator line */
}

.contact-header-social a {
    color: var(--color-primary-glow); /* Use the bright red accent color */
    font-size: 2rem; /* Make them a little bigger to draw attention */
}

.contact-header-social a:hover {
    color: var(--color-secondary-blue); /* Blue hover provides excellent contrast */
}

/* Footer Social Links (Keep them centered and smaller) */
.footer-social {
    justify-content: center; 
    margin-bottom: 10px;
}

.footer-social a {
    color: var(--color-text-subtle);
    font-size: 1.5rem; 
}

.hamburger { /* Mobile Menu icon */
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-text-light);
    transition: all var(--transition-speed);
}



/*=====================================
  8A. COURSES SECTION (Actionable Card Grid Style)
=======================================*/
.courses-section {
    background-color: var(--color-mid-dark); 
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.course-card {
    background-color: var(--color-dark-bg);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
    /* Ensure the button is spaced out nicely at the bottom */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 25px var(--color-secondary-blue); /* Use the primary glow (red) for courses */
}

.course-icon {
    font-size: 3rem;
    color: var(--color-secondary-blue);
    margin-bottom: 15px;
}

.course-card h3 {
    color: var(--color-text-light);
    margin-bottom: 10px;
    font-weight: 700;
}

.course-card p {
    color: var(--color-text-subtle);
    font-size: 0.95rem;
    margin-bottom: 25px; /* Space above the button */
    flex-grow: 1; /* Pushes the button to the bottom */
}

.register-btn {
    width: 100%; /* Make the button full width of the card */
    margin-top: auto;
}

/*=====================================
  8B. SERVICES SECTION (Grid Card Style)
=======================================*/
.services-section {
    background-color: var(--color-dark-bg);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.service-card {
    background-color: var(--color-mid-dark);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px var(--color-primary-glow); /* Red glow on hover */
}

.service-icon {
    font-size: 2.5rem;
    color: var(--color-secondary-blue);
    margin-bottom: 15px;
}

.service-card h3 {
    color: var(--color-text-light);
    font-weight: 600;
}

.section-note {
    text-align: center;
    margin-top: 40px;
    color: var(--color-text-subtle);
    font-style: italic;
}

@media (min-width: 768px) {

    header .container {
        padding: 10px 20px; /* Slightly reduced padding to center logo visually */
    }

    nav {
        display: flex;
        flex-direction: row;
        position: static;
        box-shadow: none;
        width: auto;
    }
    nav a {
        padding: 8px 15px;
    }
    .hamburger {
        display: none;
    }
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    transition: all var(--transition-speed);
    border: 2px solid transparent;
}

.primary-btn {
    background-color: transparent;
    color: var(--color-primary-glow);
    border: 2px solid var(--color-primary-glow);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.primary-btn:hover {
    background-color: var(--color-primary-glow);
    color: var(--color-dark-bg);
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--color-primary-glow);
}

/*=====================================
  3. Dynamic ECG Scroll Progress Bar
=======================================*/
.ecg-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.5);
}

.ecg-progress-line {
    height: 100%;
    width: 0%;
    /* Creates the ECG pattern filling effect */
    background: repeating-linear-gradient(
        -45deg,
        var(--color-primary-glow),
        var(--color-primary-glow) 5px,
        transparent 5px,
        transparent 10px
    );
    transition: width 0.1s ease-out;
}


/*=====================================
  4. Hero Section - The Living Heart
=======================================*/
/* .hero-section {
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at 50% 50%, rgba(20, 20, 40, 0.8), var(--color-dark-bg) 70%);
} */


.hero-section {
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Removed text-align: center; here, will center content via grid */
    background: radial-gradient(circle at 50% 50%, rgba(20, 20, 40, 0.8), var(--color-dark-bg) 70%);
}

.hero-container {
    position: relative; 
    z-index: 10;
    padding: 20px;
    width: 100%;
    /* New: Use grid to position image and text */
    display: grid;
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 40px;
    align-items: center;
    text-align: center; /* Default center for mobile */
}

/* Image Styling - The Hologram Effect */
.doctor-visual {
    order: 1; /* Image first on mobile */
    text-align: center;
}

/* Image Styling - The Hologram Effect (UPDATED FOR COLOR) */
.doctor-hero-photo {
    width: 100%;
    max-width: 300px; 
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    
    /* CREATIVE STYLING: The Digital Effect (Full Color Default) */
    opacity: 0.8; 
    /* REMOVED: grayscale(100%) */
    filter: brightness(100%) drop-shadow(0 0 15px var(--color-secondary-blue));
    border: 3px solid var(--color-secondary-blue); /* Electric Blue frame remains */
    transition: filter 0.5s;
}

.doctor-hero-photo:hover {
    /* The hover effect is still strong, switching the shadow color */
    filter: drop-shadow(0 0 20px var(--color-primary-glow)); /* Now only changes the shadow color to Red */
    border: 3px solid var(--color-primary-glow); /* Changes border color to Red */
}

/* Text Content Styling */
.hero-content {
    order: 2; /* Text second on mobile */
    padding: 20px 0;
}

.main-title, .tagline, .pre-headline {
    text-align: center; /* Ensure text is centered on mobile */
}

.hero-content {
    position: relative; /* Must be relative to sit above the canvas */
    z-index: 10;
    padding: 20px;
}

.main-title {
    font-size: clamp(3rem, 10vw, 6rem);
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(231, 76, 60, 0.7);
}

.hero-content .pre-headline {
    font-size: 1.2rem;
    color: var(--color-text-subtle);
    margin-bottom: 5px;
}

.hero-content .tagline {
    font-size: 1.5rem;
    margin-bottom: 40px;
    font-style: italic;
    color: var(--color-secondary-blue);
}

/* SVG Canvas Styling (Background) */
#heartCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Keyframe for continuous, large-scale heartbeat (Injected by JS) */


/*=====================================
  5. ECG Transition Separator
=======================================*/
.ecg-transition {
    width: 100%;
    height: 100px;
    background-color: var(--color-dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ecg-svg {
    width: 100%;
    height: 80px;
    /* CSS animation is applied to the path element in JS */
}

@keyframes draw-ecg {
    to { stroke-dashoffset: 0; }
}


/*=====================================
  6. About Section - Artery Map
=======================================*/
.two-col-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: flex-start;
}

.about-text-col {
    order: 1; /* Text first on mobile */
}

.about-visual {
    order: 2; /* Visual second on mobile */
    width: 100%;
    text-align: center;
}

.doctor-photo {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.sub-section-title {
    color: var(--color-secondary-blue);
    margin-bottom: 15px;
    text-align: center;
}

.artery-map {
    width: 100%;
    height: auto;
    max-width: 400px;
    filter: drop-shadow(0 0 5px rgba(52, 152, 219, 0.5));
}

/* Animation for Blood Flow/Artery Pulse (Injected by JS) */
.flow-path {
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
}


@media (min-width: 768px) {
    .two-col-grid {
        flex-direction: row;
        align-items: center;
    }
    .about-text-col {
        order: 1;
        flex: 1;
        padding-right: 20px;
    }
    .about-visual {
        order: 2;
        flex: 1;
    }
    .doctor-photo {
        float: left;
        margin-right: 20px;
        max-width: 200px;
    }
}


/*=====================================
  7. Experience Section (Timeline)
=======================================*/
.experience-section {
    background-color: var(--color-mid-dark);
}
.timeline {
    position: relative;
    padding: 20px 0;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background-color: var(--color-secondary-blue);
}
.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 50px;
}
.timeline-dot {
    position: absolute;
    left: 14px;
    top: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--color-primary-glow);
    border: 3px solid var(--color-mid-dark);
    box-shadow: 0 0 5px var(--color-primary-glow);
}
.timeline-date {
    color: var(--color-secondary-blue);
}
.timeline-hospital, .card p {
    color: var(--color-text-subtle);
}

.house-job-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.card {
    background-color: var(--color-dark-bg);
    padding: 20px;
    border-left: 5px solid var(--color-primary-glow);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}


/*=====================================
  8. Expertise Section
=======================================*/
.expertise-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}
.expertise-card {
    background-color: var(--color-mid-dark);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    transition: transform var(--transition-speed);
    text-align: center;
    border: 1px solid rgba(231, 76, 60, 0.2);
}
.expertise-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px var(--color-secondary-blue);
}
.expertise-icon {
    font-size: 2.5rem;
    color: var(--color-secondary-blue);
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.8);
    margin-bottom: 15px;
}

/* DESKTOP LAYOUT (Side-by-Side) */
@media (min-width: 900px) {
    .hero-container {
        grid-template-columns: 0.8fr 1.2fr; /* Image takes slightly less space than text */
        text-align: left; /* Align text to the left on desktop */
    }
    
    .doctor-visual {
        order: 1;
        text-align: right; /* Align image to the right edge of its column */
    }
    
    .hero-content {
        order: 2;
        padding-left: 40px;
    }

    .main-title, .tagline, .pre-headline {
        text-align: left; /* Left align text on desktop */
    }
}

@media (min-width: 600px) {
    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 992px) {
    .expertise-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Unique Icon Animations */
@keyframes heart-pulse-subtle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes flask-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
.expertise-card:nth-child(1) .expertise-icon { animation: heart-pulse-subtle 2s infinite ease-in-out; }
.expertise-card:nth-child(4) .expertise-icon { animation: flask-bob 2.5s infinite ease-in-out; }


/*=====================================
  9. Contact Section - UPDATED FIX
=======================================*/
.contact-section {
    background-color: var(--color-dark-bg);
}
.contact-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contact-form {
    flex: 1;
    background-color: var(--color-mid-dark);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    /* FLEXBOX FOR STACKING: ensures elements flow correctly */
    display: flex;
    flex-direction: column; 
    gap: 15px; /* Spacing between input groups/elements */
}

/* Container for Name/Email to be side-by-side on desktop */
.form-group-inline {
    display: flex;
    flex-direction: column; /* Stack vertically on mobile first */
    gap: 15px;
}

/* General form element styling */
.contact-form label {
    display: block; /* Make label take its own line */
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--color-text-light);
}

.contact-form input,
.contact-form textarea {
    width: 100%; /* Ensure input/textarea takes full width */
    padding: 12px;
    background-color: #252540;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 1rem;
    color: var(--color-text-light);
    resize: vertical;
}

.contact-info p {
    color: var(--color-text-subtle);
}
.contact-info i {
    color: var(--color-primary-glow);
}

@media (min-width: 768px) {
    .contact-grid {
        flex-direction: row;
    }
    
    /* DESKTOP LAYOUT FIX: makes Name and Email sit next to each other */
    .form-group-inline {
        flex-direction: row; /* Switch to horizontal on desktop */
        gap: 20px;
    }
    .form-group-inline > div {
        flex: 1; /* Make Name and Email sections equal width */
    }

    .contact-form button {
        width: auto;
        align-self: flex-start; /* Align button to the start on desktop */
    }
}


/*=====================================
  10. Footer
=======================================*/
footer {
    background-color: #0d0d1a;
    color: var(--color-text-subtle);
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}
footer .fa-heart {
    color: var(--color-primary-glow);
}