/* Brand Colors */
:root {
    --chan-red: #E3001B;
    --chan-blue: #000080;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: #212529;
    scroll-behavior: smooth;
}

.text-danger {
    color: var(--chan-red) !important;
}

.bg-danger {
    background-color: var(--chan-red) !important;
}

.btn-danger {
    background-color: var(--chan-red);
    border-color: var(--chan-red);
}

.btn-danger:hover {
    background-color: #c00017;
    border-color: #c00017;
}

/* Navbar overrides */
.main-navbar .nav-link.active {
    color: var(--chan-red) !important;
}

/* Hero Carousel */
.carousel-item {
    height: 75vh;
    min-height: 500px;
}

.hero-slide {
    height: 100%;
    width: 100%;
}

/* Partner Boxes */
.partner-box {
    transition: all 0.3s ease;
    min-height: 80px;
}

.partner-box:hover {
    background-color: var(--chan-blue) !important;
    color: white !important;
    border-color: var(--chan-blue) !important;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Service Cards */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

/* =========================================
   PARTNERS CAROUSEL SECTION
   ========================================= */
.partners-wrapper {
    position: relative;
    padding: 0 40px;
    /* Space for the scroll buttons */
}

.partners-scroll-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
    padding: 40px 0;
    /* Added top/bottom padding to allow hover expansion */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.partners-scroll-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* Base card state */
.partner-card {
    flex: 0 0 calc(25% - 15px);
    /* 4 items per row */
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

/* Image Container - Default State */
.partner-img-box {
    width: 200px;
    height: 200px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.partner-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Text Label - Hidden by default */
.partner-name {
    position: absolute;
    top: 100%;
    /* Position it directly below the image box */
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--chan-blue);
    text-align: center;
    line-height: 1.3;

    /* Hide by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    width: 140%;
    /* Allow text to span wider than the 200px box */
    pointer-events: none;
}

/* HOVER STATE - Scale up to 400x400 */
.partner-card:hover {
    z-index: 10;
}

.partner-card:hover .partner-img-box {
    /* Use scale for smoother animation without breaking the flex grid */
    transform: scale(2);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--chan-red);
}

/* Show text on hover */
.partner-card:hover .partner-name {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    /* Push text down to accommodate the scaled 400px image */
    margin-top: 215px;
    color: var(--chan-red);
}

/* Scroll Buttons */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: var(--chan-blue);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 20;
    transition: background 0.2s;
}

.scroll-btn:hover {
    background: var(--chan-red);
}

.scroll-btn.prev {
    left: -10px;
}

.scroll-btn.next {
    right: -10px;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .partner-card {
        flex: 0 0 calc(33.333% - 14px);
    }

    /* 3 items */
}

@media (max-width: 768px) {
    .partner-card {
        flex: 0 0 calc(50% - 10px);
    }

    /* 2 items */

    /* Disable hover scaling on mobile so it doesn't break the screen */
    .partner-card:hover .partner-img-box {
        transform: none;
    }

    .partner-card:hover .partner-name {
        margin-top: 15px;
        font-size: 0.9rem;
    }

    /* On mobile, since hover doesn't work well, show the names by default slightly faded */
    .partner-name {
        position: relative;
        top: auto;
        margin-top: 10px;
        opacity: 1;
        visibility: visible;
        transform: none;
        width: 100%;
        font-size: 0.8rem;
    }
}



/* =========================================
   ABOUT PAGE SPECIFIC STYLES
   ========================================= */

/* Custom List styling for Objectives/Core Competences */
.custom-list .list-group-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 0;
    font-size: 0.95rem;
    color: #444;
}

.custom-list .list-group-item:last-child {
    border-bottom: none;
}

.custom-list .mdi {
    font-size: 1.2rem;
    vertical-align: middle;
}

/* Depot Cards */
.depot-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.depot-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.depot-card .card-header {
    border-radius: 12px 12px 0 0;
}

/* =========================================
   TEAM PAGE SPECIFIC STYLES
   ========================================= */

.team-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 15px;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.team-img-wrapper {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, var(--chan-red), var(--chan-blue));
    transition: transform 0.3s ease;
}

.team-card:hover .team-img-wrapper {
    transform: scale(1.05);
}

.team-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    background-color: #f8f9fa;
}

/* Social Icon Hover */
.team-card .mdi {
    transition: color 0.2s ease;
}

.team-card .mdi:hover {
    color: var(--chan-red) !important;
}


/* =========================================
   SERVICES PAGE SPECIFIC STYLES
   ========================================= */

/* Sticky Sidebar Nav */
.custom-nav-list .list-group-item {
    color: #555;
    transition: all 0.2s ease;
}

.custom-nav-list .list-group-item:hover,
.custom-nav-list .list-group-item:focus {
    background-color: #f8f9fa;
    color: var(--chan-red);
    padding-left: 1.5rem;
    /* Slight indent on hover */
}

/* Smooth Scrolling Offset (so content isn't hidden under the sticky navbar) */
html {
    scroll-padding-top: 100px;
}

/* Custom Accordion Styling for HSS Section */
.custom-accordion .accordion-button {
    background-color: #fff;
}

.custom-accordion .accordion-button:not(.collapsed) {
    background-color: #f8f9fa;
    color: var(--chan-blue) !important;
    box-shadow: none;
}

.custom-accordion .accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, .125);
}

.custom-accordion .accordion-button::after {
    background-size: 1rem;
}



/* =========================================
   PAST PROJECTS PAGE (SPLIT CARD LAYOUT)
   ========================================= */

.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08) !important;
}

/* Left side image handling */
.project-main-img {
    min-height: 350px;
    /* Ensures image covers the height of the text content */
    transition: transform 0.5s ease;
}

.project-card:hover .project-main-img {
    transform: scale(1.03);
}

/* Partner Logo Box (Strict 200x200) */
.partner-logo-box {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
}

/* Adjust logo box on smaller mobile screens */
@media (max-width: 576px) {
    .partner-logo-box {
        width: 150px;
        height: 150px;
        margin: 0 auto;
        /* Center it on mobile */
    }

    .project-card .p-4 {
        padding: 1.5rem !important;
        text-align: center;
        /* Center text on mobile */
    }

    .project-card .d-flex.flex-column {
        align-items: center;
    }

    .project-card ul {
        text-align: left;
        /* Keep list items left-aligned */
    }
}

/* Custom list adjustment */
.project-card .custom-list .list-group-item {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Gallery Modal Image Hover */
.hover-zoom {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.hover-zoom:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

/* =========================================
   CONTACT PAGE SPECIFIC STYLES
   ========================================= */

/* Custom Input Focus */
.form-floating>.form-control:focus,
.form-floating>.form-select:focus {
    border-color: var(--chan-red);
    box-shadow: 0 0 0 0.25rem rgba(227, 0, 27, 0.15);
    background-color: #fff !important;
}

.form-floating>label {
    color: #6c757d;
}

/* Map Container */
.map-container {
    border: 1px solid #e0e0e0;
    position: relative;
    padding-bottom: 75%;
    /* Aspect ratio for mobile */
    height: 0;
    overflow: hidden;
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

@media (min-width: 992px) {
    .map-container {
        padding-bottom: 0;
        height: 250px;
    }
}


/* =========================================
   GALLERY PAGE SPECIFIC STYLES
   ========================================= */

/* Masonry Layout */
.masonry-grid {
    position: relative;
    width: 100%;
}

/* Default Column Width (Mobile) */
.masonry-item {
    width: calc(50% - 10px);
    margin-bottom: 20px;
}

.masonry-item a {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.masonry-item img {
    display: block;
    transition: transform 0.5s ease;
}

/* Hover Effects */
.masonry-item:hover a {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.masonry-item:hover img {
    transform: scale(1.05);
}

/* Tablet */
@media (min-width: 768px) {
    .masonry-item {
        width: calc(33.333% - 14px);
        /* 3 columns */
    }
}

/* Desktop */
@media (min-width: 1200px) {
    .masonry-item {
        width: calc(25% - 15px);
        /* 4 columns */
    }
}

/* Custom Pagination */
.custom-pagination .page-link {
    color: var(--chan-blue);
    border: none;
    margin: 0 4px;
    border-radius: 50% !important;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.custom-pagination .page-link:hover {
    background-color: var(--chan-red);
    color: white;
    box-shadow: 0 4px 10px rgba(227, 0, 27, 0.3);
}

.custom-pagination .page-item.active .page-link {
    background-color: var(--chan-red);
    color: white;
    box-shadow: 0 4px 10px rgba(227, 0, 27, 0.3);
}

.custom-pagination .page-item.disabled .page-link {
    background-color: #f8f9fa;
    color: #ccc;
    box-shadow: none;
}

/* Optional: Remove default Fancybox border */
.fancybox__container {
    --fancybox-bg: rgba(0, 0, 128, 0.95);
}

/* =========================================
   CEO MESSAGE SECTION
   ========================================= */

/* Mobile adjustment for CEO section */
@media (max-width: 991.98px) {
    .ceo-image-wrapper {
        max-width: 400px;
        margin: 0 auto 2rem auto;
    }
    
    .ceo-message-box {
        padding-left: 1rem !important;
    }
    
    .ceo-message-box .text-muted {
        text-align: left !important; /* Justify looks bad on mobile */
    }
}