:root {
    --primary-color: #003366; /* Deep Navy Blue */
    --secondary-color: #004080; /* Slightly lighter Navy */
    --accent-color: #0059B3; /* Medium Blue */
    --highlight-color: #FFD700; /* Gold */
    --text-light: #F0F8FF; /* AliceBlue - soft off-white */
    --text-dark: #001a33; /* Very dark blue */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: url('../images/bigbk.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-light);
    text-align: justify; /* Justify all text */
    min-height: 100vh; /* Ensure the body takes up at least the full viewport height */
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0; /* Reduced from 1.5rem for uniform spacing */
}

/* Glassmorphism Card Effect */
.glass-card {
    background: rgba(1, 28, 135, 0.5); /* Darker glass effect */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 2rem;
    margin-bottom: 1rem; /* Reduced from 1.5rem for uniform spacing */
    color: #fff;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* Ensure header is above other content */
     background: rgba(1, 28, 135, 0.5); /* Darker glass effect */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--highlight-color); /* Changed to gold */
}

.logo img {
    height: 50px; /* Adjust height as needed */
    width: auto;
    display: block;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav ul li {
    margin-left: 2rem;
}

.main-nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.main-nav ul li a:hover, .main-nav ul li a.active {
    color: var(--highlight-color);
    border-bottom-color: var(--highlight-color);
    transform: translateY(-2px); /* Subtle lift effect */
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5); /* Subtle glow */
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--highlight-color);
    border-radius: 3px;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    text-align: center;
    padding-top: 80px; /* Offset for fixed header */
    position: relative; /* Needed for absolute positioning of slider background */
    overflow: hidden; /* Hide overflowing slider parts */
}

.hero-slider-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Behind the hero-content */
    overflow: hidden;
}

.hero-slider-background .slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.hero-slider-background .slide {
    min-width: 100%; /* Each slide takes full width */
    height: 100%;
    position: relative;
    overflow: hidden;
}

.hero-slider-background .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the entire slide area */
    display: block;
}

.hero-slider-background .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10; /* Above slides */
    border-radius: 5px;
    transition: background 0.3s ease;
}

.hero-slider-background .slider-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.hero-slider-background .prev {
    left: 10px;
}

.hero-slider-background .next {
    right: 10px;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative; /* Ensure it's on top of the slider background */
    z-index: 1; /* Above the slider background */
}
.hero-content.glass-card {
    /* Override the default margin-bottom from .glass-card to keep it centered within the hero */
    margin: 0 auto;
    background: rgba(1, 28, 135, 0.5); /* Reduced opacity for better image visibility */
    padding: 2rem 3rem; /* Slightly more padding for better appearance */
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero-slider-background .pagination {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10; /* Above slides */
}

.hero-slider-background .dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.hero-slider-background .dot.active {
    background: var(--highlight-color);
}

.btn {
    background: var(--highlight-color);
    color: var(--text-light);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: inline-block;
}

.btn:hover {
    background: transparent;
    border-color: var(--highlight-color);
    transform: translateY(-3px);
}

/* General Section Styling */
.page-header {
    padding-top: 150px;
    padding-bottom: 50px;
    text-align: center;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem; /* Reduced from 1.5rem for uniform spacing */
    background: gold;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgb(0, 0, 0);
    padding: 10px 25px;
    border-radius: 50px;
    display: inline-block;
    backdrop-filter: blur(10px);
    /* Removed duplicate margin-bottom: 2rem; */
    color: var(--text-light);
}

/* Utility class for consistent bottom margin */
.mb-3 {
    margin-bottom: 1rem; /* Defined for consistent section spacing */
}

/* All headings to gold color */
h1, h2, h3, h4, h5, h6 {
    color: var(--highlight-color);
}

/* --- Uniform Section Spacing --- */
/* The following rules create a uniform space between sections, compensating for inconsistent HTML structure. */

/* Remove top padding from containers inside sections to prevent double spacing */
.gallery-section .container,
.upcoming-events-section .container,
.latest-news-section .container {
    padding-top: 0;
}
/* Remove top padding from a container that directly follows a section */
.latest-news-section + .container {
    padding-top: 0;
}

.gallery-section {
    display: none;
}

/* Welcome Section */
.welcome-section .section-title { /* Specific override for welcome section title if needed */
    color: #000;
}
.welcome-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: center;
}

.commandant-img-container {
    width: 100%;
    height: auto;
}

.commandant-img {
    width: 100%;
    border-radius: 10px;
}

/* Core Values Section */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.values-grid .glass-card {
    margin-bottom: 0;
}

.value-item h3 {
    /* This was already gold, but the general h3 rule will now ensure it */
    margin-bottom: 0.5rem;
}

/* Marquee / Ticker */
.marquee {
    background: rgba(0, 25, 51, 0.4); /* Darker blue with transparency */
    padding: 1rem;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
}
.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
}
.marquee-content span {
    margin-right: 50px;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Footer */
.main-footer {
    position: sticky; /* Stick the footer to the bottom */
    top: 100vh;          /* Push it to the bottom of the viewport */
    clear: both;
    text-align: center;
    padding: 2rem;
    margin-top: 0; /* Removed to reduce space before footer */
    background: rgba(1, 28, 135, 0.5); /* Darker glass effect */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.main-footer a {
    color: #fff;
    text-decoration: none;
}

.main-footer a:hover {
    color: gold;
}

/* Add top margin to the main content to avoid being overlapped by the fixed header */
.page-content {
    flex: 1; /* Allow page content to grow and fill the space */
    min-height: calc(100vh - 161px);
    padding-top: 80px; /* Adjust based on your header's height */
}

/* Latest News Section */
.latest-news-section {
    padding: 1.0rem 0;
}

.news-scroller {
    overflow: hidden; /* Hide the overflowing content */
    white-space: nowrap; /* Prevent items from wrapping */
    padding: 1rem 0 1rem 0;
}

.news-scroller-content {
    display: inline-block;
    animation: scroll-left 40s linear infinite;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.news-card {
    width: 320px; /* Fixed width for the card */
    min-height: 200px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block; /* Changed from flex to allow horizontal scroll animation */
    vertical-align: top; /* Align cards to the top */
    margin-right: 2rem; /* This will act as the gap */
    padding: 1.0rem; /* Use existing glass-card padding */
    white-space: normal; /* Allow text to wrap inside the card */
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

.news-card a {
    text-decoration: none;
    color: inherit; /* Ensure the link text inherits the card's color */
}

.news-card img {
    width: 100%; /* Make image responsive to the card's width */
    height: 150px; /* Set a fixed height for the thumbnails */
    object-fit: cover; /* Ensure images cover the area without distortion */
    border-radius: 10px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.news-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card-content p {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.news-card-content .read-more {
    color: var(--highlight-color);
    font-weight: 600;
    align-self: flex-start;
}

.get-in-touch-section {
    text-align: center;
    margin-bottom: 0; /* Removed to reduce space before footer */
}

.get-in-touch-section a {
    color: var(--highlight-color);
    font-weight: 600;
}

.section-title {
    color: rgb(0, 0, 0);
}

/* Video Section */
.video-section {
    padding: 2rem 0;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 15px; /* Match glass-card */
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Gallery Section */
/* Spacing for this section is now handled by the global .container rules and the overrides above. */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.0 rem;
}

.gallery-item {

    /* Apply glass-card styling to each gallery item */
    background: rgba(1, 28, 135, 0.5); /* Primary blue with transparency */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 1rem; /* Adjust padding as needed */
    text-align: center; /* Center image and text within the card */
}

.gallery-item img {
    width: 100%;
    height: 250px; /* Set a fixed height for uniform look */
    object-fit: cover;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Partners Section */
.partners-section {
    /* Removed padding: 0 to allow glass-card padding to apply, fixing alignment */
}
.partners-scroller {
    overflow: hidden;
    position: relative;
    width: 100%;
    -webkit-mask-image: linear-gradient(to right, transparent, white 20%, white 80%, transparent);
    mask-image: linear-gradient(to right, transparent, white 20%, white 80%, transparent);
}
.partners-scroller-inner {
    display: flex;
    width: fit-content;
    animation: scroll 40s linear infinite;
}
.partner-logo {
    height: 80px; /* Adjust height as needed */
    margin: 0 2rem;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}
.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* Upcoming Events Section */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 0;
}
.event-card {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.event-date {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    min-width: 80px;
}
.event-date .day {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: gold;
}
.event-date .month {
    display: block;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.event-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}
.event-details .event-time {
    margin: 0;
    font-size: 0.9rem;
    color: #ccc;
}
.event-details a {
    color: gold;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: inline-block;
}

/* Publications Section */
.partners-publications-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
    align-items: stretch; /* Ensure both cards are the same height */
}

.partners-publications-grid > section {
    flex: 1;
    min-width: 300px; /* Prevent cards from becoming too narrow */
    margin-bottom: 0; /* Remove individual margins to rely on grid gap */
}

.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.publication-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem; /* Space between image and text */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.publication-preview {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.publication-preview.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.publication-info h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.publication-info p {
    font-size: 0.8rem;
    margin-bottom: 0;
    color: #ccc;
}

.publication-item .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    white-space: nowrap;
    margin-left: auto; /* Push button to the right */
}

@media (max-width: 768px) {
    .partners-publications-grid {
        grid-template-columns: 1fr;
    }

    /* Welcome Section Mobile Fix */
    .welcome-section {
        grid-template-columns: 1fr;
    }

    .commandant-img-container {
        margin-bottom: 1.5rem;
    }

    /* Mobile Navigation */
    .main-header {
        position: relative;
        height: auto;
    }

    .main-header .container {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        width: 100%;
        margin-top: 1rem;
        display: none;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav ul li {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    /* Mobile Hero */
    .hero {
        height: auto;
        min-height: 100vh;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-content.glass-card {
        padding: 1.5rem;
        width: 95%;
    }

    .page-content {
        padding-top: 0;
    }
}

@keyframes scroll {
    to {
        transform: translateX(-50%);
    }
}