:root {
    --primary-color: #373380;
    --bs-primary: #373380;
    --bs-primary-rgb: 55, 51, 128;
    /* Adjust to match logo later */
    --secondary-color: #6c757d;
}

body {
    font-family: 'Inter', sans-serif;
    color: #333;
    overflow-x: hidden;
    width: 100%;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
}

.navbar-brand {
    font-weight: 700;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 70px;
    /* Enforce logo height */
    width: auto;
    /* Maintain aspect ratio */
}

.card {
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

.btn-primary:hover, 
.btn-primary:focus, 
.btn-primary:active {
    background-color: #2b2866 !important; /* Darker #373380 */
    border-color: #2b2866 !important;
    color: #fff !important;
}

.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary:hover, 
.btn-outline-primary:focus, 
.btn-outline-primary:active {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

/* Hero Carousel Enhancements */
.carousel-item {
    transition: transform 1.2s ease-in-out, opacity 1s ease-in-out !important;
}

.carousel-image {
    transition: transform 6s ease;
    transform: scale(1);
    transform-origin: center;
}

.carousel-item.active .carousel-image {
    transform: scale(1.1);
}

.carousel-control-prev,
.carousel-control-next {
    z-index: 30;
    /* Set higher than overlay */
    width: 10%;
    /* Increase clickable area slightly */
}

.hero-overlay-container {
    pointer-events: none;
    /* Allow clicks to pass through to carousel controls */
}

.hero-overlay-container .container {
    pointer-events: auto;
    /* Re-enable clicks for buttons and text selection inside the overlay */
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: rgba(0, 0, 0, 0.1);
    /* Provide visual feedback on hover */
}

.carousel-control-prev:active,
.carousel-control-next:active {
    background: rgba(0, 0, 0, 0.2);
}

.hero-title {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

h1.display-3 {
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

#heroCarousel .lead {
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

/* Recovery Story Video Section */
.video-story-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.video-wrapper {
    border-radius: 12px !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
}

.video-wrapper iframe {
    border: none;
}

/* Team Card & Biography Modal */
.team-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}

.btn-view-bio {
    font-size: 0.8rem;
    padding: 6px 18px;
    transition: all 0.3s ease;
}

.btn-view-bio:hover {
    transform: scale(1.05);
}

.bio-modal-content {
    border-radius: 16px;
}

#bioModalText {
    font-size: 1rem;
    text-align: left;
}

/* Collaborator Links */
.collaborator-link {
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.collaborator-link:hover {
    transform: scale(1.08);
    opacity: 0.85;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {

    /* Adjust Hero Typography */
    .hero-title {
        font-size: 2rem !important;
        /* Smaller than display-3 */
    }

    .hero-overlay-container .lead {
        font-size: 1rem !important;
    }

    /* Stack buttons in hero on very small screens, but nicer */
    .hero-overlay-container .btn {
        width: 100%;
        max-width: 280px;
        /* Ensure consistency */
        margin: 0 auto 10px auto !important;
        /* Center and add gap */
        display: block;
        padding: 12px 20px !important;
        /* Adjust padding */
    }

    .hero-overlay-container {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateY(-50%) !important;
        top: 50% !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Make hero full viewport height on mobile for better impact */
    .carousel-item {
        height: 100vh !important;
        min-height: 600px;
        overflow: hidden !important;
    }

    /* Disable scale animation on mobile */
    .carousel-item.active .carousel-image {
        transform: scale(1) !important;
    }

    .carousel-inner {
        overflow: hidden !important;
    }

    .image-placeholder-container {
        min-height: 300px;
    }

    /* Adjust content padding */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* Ensure forms don't overflow */
    .form-control {
        width: 100% !important;
        max-width: 100%;
    }

    .container {
        max-width: 100% !important;
        /* width: auto !important; */
        /* padding-left: 15px;
        padding-right: 15px; */
        overflow-x: hidden;
    }

    /* Fix navbar: logo and toggler on opposite sides */
    .navbar .container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .navbar-toggler {
        margin-right: 0;
        border: none;
        /* Remove border for cleaner look */
        padding: 0.5rem;
    }

    .navbar-toggler:focus {
        box-shadow: none;
        /* Remove default focus glow */
    }

    .navbar-brand {
        font-size: 1.25rem;
        max-width: 75%;
        /* Limit width to prevent overlap with toggler */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Mobile Menu Styling */
    .navbar-collapse {
        background: #fff;
        /* Ensure background is white */
        padding-top: 10px;
        padding-bottom: 10px;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        /* Subtle separator */
        margin-top: 10px;
    }

    .nav-item {
        padding: 5px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.02);
    }

    .nav-item:last-child {
        border-bottom: none;
    }
}

/* Desktop Navbar Enhancements */
@media (min-width: 992px) {
    .navbar-nav .nav-link {
        padding-right: 1rem;
        padding-left: 1rem;
        position: relative;
        font-weight: 500;
        transition: color 0.3s ease;
    }

    .navbar-nav .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0px;
        left: 50%;
        background-color: var(--primary-color);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .navbar-nav .nav-link:hover::after,
    .navbar-nav .nav-link.active::after {
        width: 80%;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        color: var(--primary-color) !important;
    }
}