/*--------------------------------------------------------------
# CSS Variables
--------------------------------------------------------------*/
:root {
    --font-family-headings: 'Manrope', sans-serif;
    --font-family-body: 'Rubik', sans-serif;

    /* Gradient Color Scheme */
    --theme-gradient-start: #09203F; /* Deep Navy Blue */
    --theme-gradient-end: #537895; /* Steel Blue */

    /* Primary Action & Accent Colors */
    --bs-primary: #FF7F50; /* Coral - Energetic, stands out */
    --bs-primary-rgb: 255, 127, 80; /* RGB for Bootstrap alpha functions */
    --bs-secondary: #4682B4; /* SteelBlue - Complements primary */
    --theme-accent: #FFD700; /* Gold - Premium, highlight */

    /* Text Colors */
    --theme-text-dark: #222222;
    --theme-text-medium: #555555;
    --theme-text-light: #FFFFFF;
    --theme-text-muted: #adb5bd;

    /* Background Colors */
    --theme-background-light: #FFFFFF;
    --theme-background-sections: #F8F9FA;
    --theme-card-bg: #FFFFFF;
    --theme-footer-bg-start: #2c3e50;
    --theme-footer-bg-end: #34495e;

    /* UI Elements */
    --theme-border-radius: 0.375rem;
    --theme-box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    --theme-box-shadow-light: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.07);
    --theme-transition-speed: 0.3s;
    --header-height: 80px;
}

/*--------------------------------------------------------------
# Global Styles
--------------------------------------------------------------*/
body {
    font-family: var(--font-family-body);
    color: var(--theme-text-medium);
    background-color: var(--theme-background-light);
    line-height: 1.7;
    font-size: 1rem;
    overflow-x: hidden; /* Prevent horizontal scroll from animations */
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-family-headings);
    font-weight: 700;
    color: var(--theme-text-dark);
    margin-top: 0;
    margin-bottom: 0.75rem;
}

h1, .h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.2;
}

h2, .h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.25;
}

h3, .h3 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    line-height: 1.3;
}

h4, .h4 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    line-height: 1.35;
}

h5, .h5 {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.4;
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

a {
    color: var(--bs-primary);
    text-decoration: none;
    transition: color var(--theme-transition-speed) ease-in-out;
}

a:hover {
    color: var(--bs-secondary);
    text-decoration: underline;
}

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

.section-title {
    font-family: var(--font-family-headings);
    font-weight: 800;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    position: relative;
    color: var(--theme-text-dark);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

.section-title::after {
    content: "";
    position: absolute;
    display: block;
    width: 60px;
    height: 3px;
    background: var(--bs-primary);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.section-bg-gradient {
    background: linear-gradient(135deg, var(--theme-gradient-start), var(--theme-gradient-end));
    color: var(--theme-text-light);
}

.section-bg-gradient .section-title,
.section-bg-gradient h1, .section-bg-gradient h2, .section-bg-gradient h3, .section-bg-gradient h4, .section-bg-gradient h5,
.section-bg-gradient p {
    color: var(--theme-text-light);
}

.section-bg-gradient .section-title {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.section-bg-gradient .section-title::after {
    background: var(--theme-accent);
}

.section-bg-gradient .card {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.section-bg-gradient .card .card-title,
.section-bg-gradient .card .card-title a,
.section-bg-gradient .card .card-text {
    color: var(--theme-text-light) !important;
}

.section-bg-gradient .card .card-title a:hover {
    color: var(--theme-accent) !important;
}

.section-bg-gradient .btn-outline-primary {
    color: var(--theme-text-light) !important;
    border-color: var(--theme-text-light) !important;
}

.section-bg-gradient .btn-outline-primary:hover {
    background-color: var(--theme-text-light) !important;
    color: var(--theme-gradient-start) !important;
}

/*--------------------------------------------------------------
# Buttons - Global Styles
--------------------------------------------------------------*/
.btn {
    font-family: var(--font-family-headings);
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: var(--theme-border-radius);
    transition: all var(--theme-transition-speed) ease-in-out;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    box-shadow: var(--theme-box-shadow-light);
    border: 2px solid transparent;
}

.btn-primary, .custom-btn {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: var(--theme-text-light);
}

.btn-primary:hover, .custom-btn:hover {
    background-color: #E5673A; /* Darker shade of coral */
    border-color: #E5673A;
    color: var(--theme-text-light);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--theme-box-shadow);
}

.btn-secondary, .custom-btn-secondary {
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
    color: var(--theme-text-light);
}

.btn-secondary:hover, .custom-btn-secondary:hover {
    background-color: #3A6A92; /* Darker SteelBlue */
    border-color: #3A6A92;
    color: var(--theme-text-light);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--theme-box-shadow);
}

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

.btn-outline-primary:hover {
    background-color: var(--bs-primary);
    color: var(--theme-text-light);
    transform: translateY(-2px);
}

/*--------------------------------------------------------------
# Header / Navbar
--------------------------------------------------------------*/
header.sticky-top {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--theme-box-shadow-light);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.navbar-brand {
    font-family: var(--font-family-headings);
    font-weight: 800 !important;
    font-size: 1.75rem;
    color: var(--bs-primary) !important;
}

.navbar .nav-link {
    font-family: var(--font-family-headings);
    font-weight: 600;
    color: var(--theme-text-medium) !important;
    padding: 0.5rem 1rem;
    transition: color var(--theme-transition-speed);
    position: relative;
}

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

.navbar .nav-link::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--bs-primary);
    visibility: hidden;
    transform: scaleX(0);
    transition: all 0.3s ease-in-out 0s;
}

.navbar .nav-link:hover::before,
.navbar .nav-link.active::before {
    visibility: visible;
    transform: scaleX(0.7);
}

.navbar-toggler {
    border-color: rgba(0, 0, 0, 0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 127, 80, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/*--------------------------------------------------------------
# Hero Section
--------------------------------------------------------------*/
.hero-section {
    /* min-height: calc(100vh - var(--header-height)); */ /* Removed for natural height */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    padding: 6rem 0;
}

.hero-section .hero-title {
    color: var(--theme-text-light) !important;
    font-weight: 800;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    margin-bottom: 1.5rem;
}

.hero-section .hero-subtitle {
    color: var(--theme-text-light) !important;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

/*--------------------------------------------------------------
# Features Section
--------------------------------------------------------------*/
.feature-item {
    background-color: var(--theme-background-light);
    border-radius: var(--theme-border-radius);
    transition: transform var(--theme-transition-speed) ease, box-shadow var(--theme-transition-speed) ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.feature-item:hover {
    transform: translateY(-5px) perspective(1000px) rotateX(1deg) rotateY(-1deg);
    box-shadow: var(--theme-box-shadow);
}

.feature-item .animated-icon svg {
    width: 50px;
    height: 50px;
    color: var(--bs-primary);
    transition: transform 0.5s ease;
    margin-left: auto;
    margin-right: auto; /* Center SVG */
}

.feature-item:hover .animated-icon svg {
    transform: rotateY(180deg) scale(1.1);
}

.feature-item h3 {
    font-size: 1.25rem;
    color: var(--theme-text-dark);
}

.feature-item p {
    font-size: 0.95rem;
    color: var(--theme-text-medium);
    padding: 0 0.5rem;
}

.stat-widget {
    background-color: var(--theme-background-light);
    padding: 1.5rem;
    border-radius: var(--theme-border-radius);
    box-shadow: var(--theme-box-shadow-light);
}

.stat-widget:hover {
    transform: translateY(-3px);
    box-shadow: var(--theme-box-shadow);
}

.stat-widget h4 {
    color: var(--bs-primary);
    font-weight: 800;
}

.stat-widget p {
    color: var(--theme-text-medium);
    margin-bottom: 0;
}

/*--------------------------------------------------------------
# Research Section
--------------------------------------------------------------*/
#research .accordion-button {
    font-family: var(--font-family-headings);
    font-weight: 600;
    color: var(--theme-text-dark);
    background-color: var(--theme-background-sections);
    border: none;
    box-shadow: none;
}

#research .accordion-button:not(.collapsed) {
    color: var(--bs-primary);
    background-color: #fff0e6; /* Lighter shade of primary bg */
}

#research .accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

#research .accordion-item {
    border: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
    border-radius: var(--theme-border-radius);
    overflow: hidden;
}

#research .accordion-body {
    font-size: 0.95rem;
    color: var(--theme-text-medium);
}

#research img {
    border-radius: var(--theme-border-radius);
    box-shadow: var(--theme-box-shadow);
}

/*--------------------------------------------------------------
# Portfolio, Events, External Resources (Card-based sections)
--------------------------------------------------------------*/
.card {
    border: none;
    border-radius: var(--theme-border-radius);
    box-shadow: var(--theme-box-shadow-light);
    transition: transform var(--theme-transition-speed) ease-in-out, box-shadow var(--theme-transition-speed) ease-in-out;
    overflow: hidden;
    background-color: var(--theme-card-bg);
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers flex items (like card-image, card-body) horizontally */
    text-align: center; /* Centers inline content within flex items */
    height: 100%; /* For Bootstrap .h-100 class to work with flex items */
}

.card:hover {
    transform: translateY(-5px) perspective(1000px) rotateY(2deg);
    box-shadow: var(--theme-box-shadow);
}

.card .card-image {
    width: 100%;
    height: 200px; /* Fixed height for image container */
    overflow: hidden;
}

.card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--theme-transition-speed) ease-in-out;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card .card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%; /* Ensures card-body takes full width for its centered content */
}

.card .card-title {
    font-family: var(--font-family-headings);
    font-size: 1.2rem; /* Slightly smaller for cards */
    margin-bottom: 0.75rem;
    color: var(--theme-text-dark);
}

.card .card-text {
    font-size: 0.9rem;
    color: var(--theme-text-medium);
    flex-grow: 1;
    margin-bottom: 1rem;
}

.card .card-text small {
    color: var(--theme-text-muted);
}

.card .btn, .card .card-footer .btn {
    align-self: center; /* Center button within its container */
    min-width: 150px; /* Give buttons a decent min width */
}

.event-card .card-footer {
    background-color: transparent;
    border-top: none;
    padding: 0 1.25rem 1.25rem;
    width: 100%;
}

.event-card .card-footer .btn {
    width: 100%;
}

.resource-card .card-title a {
    color: var(--bs-primary);
    text-decoration: none;
}

.resource-card .card-title a:hover {
    color: var(--bs-secondary);
    text-decoration: underline;
}

/*--------------------------------------------------------------
# Contact CTA Section
--------------------------------------------------------------*/
#contact-cta {
    background-color: var(--theme-background-sections);
}

/*--------------------------------------------------------------
# Contact Page / Form (contacts.html)
--------------------------------------------------------------*/
.contact-form-section {
    padding: 3rem 0;
    background-color: var(--theme-background-light);
}

.contact-form-section .form-control,
.contact-form-section .form-select {
    font-family: var(--font-family-body);
    border-radius: var(--theme-border-radius);
    padding: 0.85rem 1rem;
    border: 1px solid #ced4da;
    transition: border-color var(--theme-transition-speed), box-shadow var(--theme-transition-speed);
    font-size: 0.95rem;
    background-color: #fdfdff; /* Slightly off-white for input fields */
}

.contact-form-section .form-control:focus,
.contact-form-section .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
    background-color: var(--theme-background-light);
}

.contact-form-section .form-label {
    font-family: var(--font-family-headings);
    font-weight: 600;
    color: var(--theme-text-dark);
    margin-bottom: 0.5rem;
}

.contact-form-section .btn[type="submit"] {
    width: 100%;
    padding: 0.85rem;
}

.contact-info-item .icon {
    font-size: 1.5rem;
    color: var(--bs-primary);
    margin-right: 1rem;
}

#contactMap iframe {
    border-radius: var(--theme-border-radius);
    box-shadow: var(--theme-box-shadow-light);
    width: 100%;
    min-height: 350px;
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
footer {
    background: linear-gradient(135deg, var(--theme-footer-bg-start), var(--theme-footer-bg-end));
    color: var(--theme-text-light);
    padding: 3rem 0 2rem 0;
    font-size: 0.9rem;
}

footer h5 {
    font-family: var(--font-family-headings);
    font-weight: 700;
    color: var(--theme-text-light);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

footer p {
    color: #bdc3c7;
    font-size: 0.9rem;
}

footer .list-unstyled li {
    margin-bottom: 0.5rem;
}

footer .footer-link {
    color: #bdc3c7;
    text-decoration: none;
    transition: color var(--theme-transition-speed), padding-left var(--theme-transition-speed);
}

footer .footer-link:hover {
    color: var(--theme-text-light);
    padding-left: 5px;
    text-decoration: none;
}

footer hr {
    border-color: rgba(255, 255, 255, 0.2);
}

footer .text-center {
    color: #bdc3c7;
}

/*--------------------------------------------------------------
# Success Page (success.html)
--------------------------------------------------------------*/
.success-page-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--theme-gradient-start), var(--theme-gradient-end));
    color: var(--theme-text-light);
}

.success-page-container h1 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    color: var(--theme-text-light);
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.success-page-container p {
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: var(--theme-text-light);
    margin-bottom: 2rem;
    max-width: 600px;
}

.success-page-container .icon-success {
    font-size: 4.5rem;
    color: var(--theme-accent);
    margin-bottom: 1.5rem;
    animation: popIn 0.5s ease-out forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-page-container .btn {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
    color: var(--theme-text-dark);
}

.success-page-container .btn:hover {
    background-color: #e6be00;
    border-color: #e6be00;
}

/*--------------------------------------------------------------
# Privacy & Terms Pages (privacy.html, terms.html)
--------------------------------------------------------------*/
.static-page-content {
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 3rem;
    min-height: calc(100vh - var(--header-height) - 180px); /* Approx footer height */
}

.static-page-content h1 {
    margin-bottom: 2rem;
}

.static-page-content h2, .static-page-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.static-page-content p, .static-page-content li {
    line-height: 1.8;
}

.static-page-content ul, .static-page-content ol {
    padding-left: 1.5rem;
}

/*--------------------------------------------------------------
# Barba.js Transitions
--------------------------------------------------------------*/
.barba-leave-active,
.barba-enter-active {
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.barba-leave-to {
    opacity: 0;
    transform: translateY(-20px);
}

.barba-enter-from {
    opacity: 0;
    transform: translateY(20px);
}

/*--------------------------------------------------------------
# Responsive Adjustments
--------------------------------------------------------------*/
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: rgba(255, 255, 255, 0.98);
        padding: 1rem;
        margin-top: 0.5rem; /* Small gap from toggler */
        border-radius: var(--theme-border-radius);
        box-shadow: var(--theme-box-shadow);
    }

    .navbar .nav-link {
        padding: 0.75rem 0;
    }

    .hero-section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
}

@media (max-width: 767.98px) {
    h1, .h1 {
        font-size: clamp(1.8rem, 7vw, 2.2rem);
    }

    h2, .h2 {
        font-size: clamp(1.6rem, 6vw, 1.9rem);
    }

    .feature-item, .stat-widget {
        margin-bottom: 1.5rem;
    }

    footer .col-lg-4, footer .col-lg-2, footer .col-lg-3 {
        text-align: center !important;
    }

    footer .list-unstyled {
        padding-left: 0;
    }
}

/* Accessibility: Focus visible */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--bs-primary) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* Cookie Popup */
#cookie-popup {
    font-family: var(--font-family-body);
}

#cookie-popup p {
    color: var(--theme-text-light);
}

#accept-cookie {
    background-color: var(--bs-primary) !important;
    color: var(--theme-text-light) !important;
    font-family: var(--font-family-headings);
    font-weight: 600;
    border-radius: var(--theme-border-radius);
    transition: background-color var(--theme-transition-speed);
}

#accept-cookie:hover {
    background-color: #E5673A !important;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: rgba(255, 255, 255, 0.98);
        padding: 1rem;
        margin-top: 22.5rem;
        border-radius: var(--theme-border-radius);
        box-shadow: var(--theme-box-shadow);
    }
}