:root {
    --primary-color: #007bff; /* Bootstrap primary blue */
    --secondary-color: #6c757d; /* Bootstrap secondary grey */
    --success-color: #28a745; /* Bootstrap success green */
    --info-color: #17a2b8; /* Bootstrap info cyan */
    --warning-color: #ffc107; /* Bootstrap warning yellow */
    --danger-color: #dc3545; /* Bootstrap danger red */
    --light-color: #f8f9fa; /* Bootstrap light grey */
    --dark-color: #343a40; /* Bootstrap dark grey */
    --white-color: #ffffff;

    /* Custom Medical Palette */
    --medical-blue: #0056b3; /* Deeper blue */
    --medical-teal: #20c997; /* Teal/Green */
    --medical-grey: #e9ecef; /* Very light grey */
    --medical-dark-grey: #495057; /* Dark text grey */
    --medical-white: #ffffff;
    --medical-light-blue: #e0f2f7; /* Very light blue for backgrounds */
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; /* More modern font stack */
    padding-top: 56px; /* Ajuste para la barra de navegación fija */
    color: var(--medical-dark-grey); /* Default text color */
    background-color: var(--medical-white);
}

/* Navbar */
.navbar {
    background-color: var(--medical-white) !important; /* White background */
    box-shadow: 0 2px 4px rgba(0,0,0,.08); /* Subtle shadow */
}

.navbar-brand {
    color: var(--medical-blue) !important; /* Blue brand text */
    font-weight: 600;
}

.navbar-nav .nav-link {
    color: var(--medical-dark-grey) !important; /* Dark grey links */
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--medical-blue) !important; /* Blue on hover/active */
    font-weight: 500;
}

/* Header/Hero Section */
.hero-section {
    height: 100vh;
    /* Background image and overlay are now handled by the carousel */
    background: none; /* Remove static background */
    background-color: var(--medical-blue); /* Fallback color */
    position: relative;
    color: var(--medical-white); /* White text */
    overflow: hidden; /* Ensure images don't overflow */
}

/* Style for the header carousel */
#headerCarousel {
    position: absolute; /* Position absolutely within hero-section */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0; /* Send to back, behind text overlay */
}

#headerCarousel .carousel-inner {
    width: 100%;
    height: 100%;
}

#headerCarousel .carousel-item {
    width: 100%;
    height: 100%;
    position: relative; /* Needed for overlay positioning */
}

#headerCarousel img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area without distorting */
}

/* Overlay for the carousel images */
.carousel-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 86, 179, 0.6); /* Semi-transparent medical-blue overlay */
    z-index: 1; /* Above the image */
}

/* Style for the text overlay on the carousel */
.hero-text-overlay {
    position: absolute; /* Changed from relative */
    top: 0; /* Position from top */
    left: 0; /* Position from left */
    right: 0; /* Position from right */
    bottom: 0; /* Position from bottom */
    z-index: 2; /* Ensure text is on top */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center content */
    align-items: center; /* Horizontally center content */
    padding-top: 56px; /* Account for fixed navbar */
    /* text-align: center; -- Already have text-center in HTML, but can add here */
    pointer-events: none; /* Allow clicks to pass through to elements below */
}

.hero-text-overlay h1 {
     font-weight: 700;
     margin-bottom: 10px;
     text-shadow: 2px 2px 4px rgba(0,0,0,0.3); /* Add subtle text shadow for readability */
     pointer-events: auto; /* Re-enable pointer events for text content */
}

.hero-text-overlay .lead {
     font-size: 1.5rem;
     font-weight: 300;
     text-shadow: 1px 1px 3px rgba(0,0,0,0.3); /* Add subtle text shadow for readability */
     pointer-events: auto; /* Re-enable pointer events for text content */
}

/* Carousel indicators and controls styling */
#headerCarousel .carousel-indicators button {
    background-color: var(--medical-white); /* White indicators for contrast on blue overlay */
    border: 1px solid var(--medical-blue);
    pointer-events: auto; /* Ensure indicators are clickable */
    z-index: 4; /* Give indicators a higher z-index than text overlay */
}
#headerCarousel .carousel-indicators button.active {
     background-color: var(--medical-blue); /* Blue active indicator */
}

#headerCarousel .carousel-control-prev-icon,
#headerCarousel .carousel-control-next-icon {
    /* Invert filter makes blue on a dark background, may need adjustment */
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%); /* Make arrows white */
    z-index: 3; /* Ensure controls are above overlay and text */
}

#headerCarousel .carousel-control-prev,
#headerCarousel .carousel-control-next {
    z-index: 3; /* Ensure the button elements themselves have a high z-index */
    pointer-events: auto; /* Ensure controls are clickable */
}

/* Sections */
section {
    padding: 60px 0; /* Consistent padding */
}

section#about {
    background-color: var(--medical-white); /* White background */
}

section#education {
    background-color: var(--medical-light-blue); /* Light blue background */
}

section#experience {
    background-color: var(--medical-white); /* White background */
}

section#achievements {
    background-color: var(--medical-light-blue); /* Alternate light blue background */
}

h2 {
    color: var(--medical-blue); /* Blue headings */
    font-weight: 600;
    margin-bottom: 40px; /* More space below headings */
}

/* About Section */
#about img {
    border: 8px solid var(--medical-white); /* White border */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Subtler shadow */
    transition: transform 0.3s ease; /* Add transform for hover effect */
}

#about img:hover {
     transform: scale(1.05); /* Slightly enlarge image on hover */
}

/* List Group Items (Education/Experience) */
.list-group-item {
    border-color: var(--medical-grey); /* Lighter border */
    margin-bottom: 15px; /* Space between items */
    padding: 20px; /* More padding */
    border-radius: 5px; /* Rounded corners */
    background-color: var(--medical-white); /* Ensure white background */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Very subtle shadow */
}

.list-group-item strong {
    color: var(--medical-blue); /* Blue title */
    font-size: 1.2em; /* Slightly larger title */
    margin-bottom: 8px;
}

.list-group-item p {
    font-size: 1em;
    line-height: 1.6;
    color: var(--medical-dark-grey);
}

.list-group-item .text-muted {
    color: var(--secondary-color) !important; /* Use Bootstrap secondary for muted text */
    font-size: 0.9em;
    margin-top: 5px;
}

/* Contact Section */
#contact a {
    color: var(--medical-blue); /* Blue link */
    text-decoration: none;
    transition: color 0.3s ease;
}

#contact a:hover {
    color: var(--medical-teal); /* Teal on hover */
    text-decoration: underline;
}

.btn-primary {
    background-color: var(--medical-teal); /* Teal button */
    border-color: var(--medical-teal);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #1abc9c; /* Slightly darker teal */
    border-color: #1abc9c;
}

/* New Section for Achievements/Carousel */
section#achievements {
    background-color: var(--medical-light-blue); /* Alternate light blue background */
}

#achievements .carousel-item {
    min-height: 250px; /* Minimum height for carousel items */
    padding: 20px; /* Keep padding */
    text-align: center; /* Center text block content */
}

#achievements .carousel-content {
     width: 100%; /* Ensure content div takes full width */
     max-width: 700px; /* Max width for content text */
     margin: auto; /* Center content div */
}

#achievements .carousel-item h3 {
    color: var(--medical-blue); /* Blue heading */
    margin-bottom: 15px;
    font-weight: 600;
}

#achievements .carousel-item p {
    color: var(--medical-dark-grey); /* Dark grey text */
    line-height: 1.7;
}

#achievements .carousel-indicators button {
    background-color: var(--medical-blue); /* Blue indicators */
}

#achievements .carousel-control-prev-icon,
#achievements .carousel-control-next-icon {
    filter: invert(20%) sepia(90%) saturate(3000%) hue-rotate(200deg) brightness(80%); /* Make arrows blue */
}

/* Footer */
footer {
    background-color: var(--dark-color); /* Dark grey footer */
    color: var(--light-color); /* Light text */
}

footer p {
    margin-bottom: 0;
    font-size: 0.9em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        height: 70vh; /* Adjust height on smaller screens */
        /* padding-top: 60px; Removed, handled by hero-text-overlay */
    }

    .hero-text-overlay {
         padding-top: 56px; /* Still need padding for navbar */
    }

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

    .hero-section .lead {
        font-size: 1.2rem;
    }

    #about img {
        max-width: 200px; /* Smaller image on small screens */
        margin-bottom: 30px !important;
    }
}

/* Added h-100 and w-100 utility classes in HTML for carousel elements for clarity */
/* Added img-cover class for object-fit: cover */
.img-cover {
    object-fit: cover;
}