﻿/* ============================================================
   THEME TOKENS & FONTS
   ============================================================ */
:root {
    --font-sans: "Montserrat", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    /* layout tokens */
    --section-gap: 2.5rem;
    --section-gap-lg: 3.5rem;
    /* radius & shadows (unified) */
    --radius: 12px;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.14);
    --shadow-soft: 0 2px 18px rgba(0,0,0,.09);
    --shadow-soft-hover: 0 6px 26px rgba(0,0,0,.12);
}

/* ============================================================
   THEME VARIABLES
   ============================================================ */
[data-theme="Light"] {
    --color-primary: #1d4749;
    --color-secondary: #6c757d;
    --color-bg: #ffffff;
    --color-surface: #f8f9fa;
    --color-text: #212529;
    --color-muted: #6c757d;
    --color-hover: #e9ecef;
}

[data-theme="Dark"] {
    --color-primary: #122829;
    --color-secondary: #393e46;
    --color-bg: #121212;
    --color-surface: #1f1f1f;
    --color-text: #f8f9fa;
    --color-muted: #bbbbbb;
    --color-hover: rgba(255,255,255,0.1);
}

[data-theme="BlueGreen"] {
    --color-primary: #006699;
    --color-secondary: #009966;
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-muted: #555555;
    --color-hover: rgba(0,200,200,0.1);
}

/* ============================================================
   GLOBAL BASE
   ============================================================ */
html, body {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary);
    letter-spacing: -0.3px;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
}

h2, h3, h4, h5 {
    text-transform: uppercase;
}

h2 {
    font-size: 1.6em;
}

.overlay h6 {
    color: #fff;
    text-transform: uppercase;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color .2s ease, opacity .2s ease;
}

    a:hover {
        color: var(--color-secondary);
    }

/* Section spacing */
.section-gap {
    margin-top: var(--section-gap);
}

@media (min-width: 992px) {
    .section-gap {
        margin-top: var(--section-gap-lg);
    }
}

/* Tiêu đề section: căn giữa, bỏ gạch chân */
.section-title {
    display: block;
    text-align: center;
    margin: 2rem 0 1rem;
    padding-bottom: 0;
    border: 0;
    color: var(--color-primary);
    text-transform: uppercase;
}

    .section-title > a {
        color: inherit;
        text-decoration: none;
    }

        .section-title > a:hover {
            text-decoration: none;
            opacity: .9;
            color: var(--color-secondary);
        }

/* ============================================================
   NAVBAR & FOOTER
   ============================================================ */
.navbar-theme {
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary)) !important;
}

    .navbar-theme .nav-link, .navbar-theme .navbar-brand {
        color: #fff !important;
    }

        .navbar-theme .nav-link:hover {
            opacity: .85;
        }

.navbar .nav-link.active {
    font-weight: 700;
    text-decoration: underline;
}

.navbar-nav .nav-link {
    white-space: nowrap;
    text-transform: uppercase;
}

.navbar-nav {
    flex-wrap: wrap;
}

.navbar-theme .navbar-toggler-icon {
    filter: invert(1);
}
/* fallback tint */
.navbar-toggler-icon {
    filter: invert(34%) sepia(22%) saturate(615%) hue-rotate(130deg) brightness(95%) contrast(93%);
}

.footer, .footer-theme {
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
    color: #fff;
}

    .footer a, .footer-theme a {
        color: #fff;
    }

        .footer a:hover, .footer-theme a:hover {
            opacity: .8;
        }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    background-color: var(--color-primary);
    border: none;
}

    .btn-primary:hover {
        background-color: var(--color-secondary);
    }

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

    .btn-outline-primary:hover {
        background-color: var(--color-primary);
        color: #fff;
    }

/* Dark outline fixes */
[data-theme="Dark"] .btn-outline-primary {
    border-color: var(--color-primary);
    background: transparent;
}

    [data-theme="Dark"] .btn-outline-primary:hover {
        background-color: var(--color-primary) !important;
        color: #fff !important;
    }

[data-theme="Dark"] .btn-outline-danger {
    border-color: #dc3545;
    background: transparent;
}

    [data-theme="Dark"] .btn-outline-danger:hover {
        background: #dc3545 !important;
        color: #fff !important;
    }

/* Link-like button */
.btn-link {
    color: var(--color-primary) !important;
    text-decoration: none;
    font-weight: 500;
    padding: .375rem .75rem;
    border-radius: .375rem;
    transition: background-color .2s ease, color .2s ease;
    background-color: transparent;
}

    .btn-link:hover, .btn-link:focus {
        color: #fff !important;
        background-color: var(--color-secondary) !important;
    }

[data-theme="Dark"] .btn-link {
    background: transparent;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background-color: var(--color-surface);
    border: 1px solid rgba(0,0,0,.05);
    border-radius: .5rem;
    transition: transform .2s ease, box-shadow .2s ease;
    color: var(--color-text);
}

    .card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }

/* Dark stronger borders */
[data-theme="Dark"] .card,
[data-theme="Dark"] .service-card,
[data-theme="Dark"] .partner-item,
[data-theme="Dark"] .project-progress {
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    background-color: #1e1e1e;
}

/* ============================================================
   PROGRESS
   ============================================================ */
.progress {
    background-color: rgba(255,255,255,0.1);
    border-radius: 50px;
    height: 8px;
}

.progress-bar {
    width: 0%;
    transition: width .5s ease-in-out;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary)) !important;
    color: #fff;
    font-weight: 600;
    font-size: .75rem;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-theme th {
    background: var(--color-primary);
    color: #fff;
    border: none;
}

.card .table {
    border-radius: .75rem;
    overflow: hidden;
}

.job-table th {
    background-color: var(--color-primary);
    color: #fff;
    border: none;
}

[data-theme="Light"] .job-table td {
    background: #fff;
    color: #212529;
}

[data-theme="Dark"] .job-table td {
    background: #1e1e1e;
    color: #f1f1f1;
}

.job-table tr:hover td {
    background-color: rgba(0,0,0,.05);
}

[data-theme="Dark"] .job-table tr:hover td {
    background-color: rgba(255,255,255,.05);
}

/* ============================================================
   PARTNERS CAROUSEL
   ============================================================ */
.partners-wrapper {
    overflow: hidden;
    width: 100%;
}

.partners-track {
    display: flex;
    gap: 1rem;
    will-change: transform;
}

.partners-list {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.partner-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border-radius: 12px;
    border: 1px solid var(--color-primary);
    background-color: var(--color-surface, #fff);
    overflow: hidden;
    flex-shrink: 0;
}

    .partner-item img {
        height: 60px;
        width: auto;
        object-fit: contain;
        display: block;
    }

/* ============================================================
   SERVICE CARD
   ============================================================ */
.service-card {
    position: relative;
    overflow: hidden;
    height: 220px;
    border-radius: 8px;
    color: #fff;
    border: none;
}

    .service-card .card-img {
        height: 100%;
        background-size: cover;
        background-position: center;
        transition: transform .4s ease;
    }

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

    .service-card .overlay {
        position: absolute;
        inset: auto 0 0 0;
        height: 40%;
        padding: 1rem;
        background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0));
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        transition: background .4s ease, transform .4s ease;
    }

    .service-card:hover .overlay {
        background: linear-gradient(to top, rgba(0,0,0,.9), rgba(0,0,0,0));
        transform: translateY(-5px);
    }

/* ============================================================
   GLOBAL LAYOUT EXTRAS
   ============================================================ */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    background-color: var(--color-primary);
    transition: all .3s ease;
    text-decoration: none;
}

    .social-link:hover {
        background-color: var(--color-secondary);
        color: #fff !important;
    }

.floating-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1050;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 8px rgba(0,0,0,.25);
    transition: transform .2s, background .2s;
    text-decoration: none;
}

    .floating-btn:hover {
        background: var(--color-secondary);
        transform: scale(1.1);
        color: #fff;
    }

    .floating-btn img {
        width: 26px;
        height: 26px;
    }

/* Dropdown reveal removed to fix conflicts */

/* ============================================================
   DARK THEME FIXES
   ============================================================ */
[data-theme="Dark"] .card-text,
[data-theme="Dark"] p,
[data-theme="Dark"] .partner-desc,
[data-theme="Dark"] .project-desc,
[data-theme="Dark"] .text-muted,
[data-theme="Dark"] .fw-semibold {
    color: #f1f1f1 !important;
}

[data-theme="Dark"] strong,
[data-theme="Dark"] b,
[data-theme="Dark"] .fw-bold,
[data-theme="Dark"] .fw-semibold {
    color: #fff !important;
}

[data-theme="Dark"] h1, [data-theme="Dark"] h2, [data-theme="Dark"] h3,
[data-theme="Dark"] h4, [data-theme="Dark"] h5, [data-theme="Dark"] h6 {
    color: lightgrey !important;
}

[data-theme="Dark"] .progress-bar {
    color: #fff !important;
}

[data-theme="Dark"] .modal-content {
    background: #2b2b2b;
    color: #f1f1f1;
}

[data-theme="Dark"] .modal-header, [data-theme="Dark"] .modal-footer {
    border-color: #444;
}

[data-theme="Dark"] .form-label {
    color: #ddd;
}

[data-theme="Dark"] .form-control, [data-theme="Dark"] .form-select {
    background: #3a3a3a;
    color: #f1f1f1;
    border-color: #555;
}

    [data-theme="Dark"] .form-control:focus {
        border-color: #777;
    }

[data-theme="Dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Search input base */
/* Search input base (desktop) */
@media (min-width: 768px) {
    form .form-control { min-width: 300px; }
}
@media (max-width: 767.98px) {
    form .form-control { min-width: 0; width: 100%; }
}

[data-theme="Dark"] .form-control {
    background: #a1a1a1;
    color: #1f1f1f;
    border: 1px solid var(--color-primary);
}

    [data-theme="Dark"] .form-control:focus {
        background: #f1f1f1;
        border-color: var(--color-secondary);
        box-shadow: 0 0 0 .2rem rgba(255,255,255,.1);
    }

/* Search buttons by theme */
[data-theme="Light"] .btn-search {
    background: #0d6efd;
    color: #fff;
    border: none;
}

    [data-theme="Light"] .btn-search:hover {
        background: #0b5ed7;
    }

[data-theme="Light"] .btn-reset {
    background: #6c757d;
    color: #fff;
    border: none;
}

    [data-theme="Light"] .btn-reset:hover {
        background: #5c636a;
    }

[data-theme="BlueGreen"] .btn-search {
    background: #009688;
    color: #fff;
    border: none;
}

    [data-theme="BlueGreen"] .btn-search:hover {
        background: #00796b;
    }

[data-theme="BlueGreen"] .btn-reset {
    background: #607d8b;
    color: #fff;
    border: none;
}

    [data-theme="BlueGreen"] .btn-reset:hover {
        background: #546e7a;
    }

[data-theme="Dark"] .btn-search {
    background: #4ea3ff;
    color: #fff;
    border: none;
}

    [data-theme="Dark"] .btn-search:hover {
        background: #1f7fe5;
    }

[data-theme="Dark"] .btn-reset {
    background: #444;
    color: #eee;
    border: none;
}

    [data-theme="Dark"] .btn-reset:hover {
        background: #666;
        color: #fff;
    }

/* ============================================================
   NEWS LIST
   ============================================================ */
.news-item {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-primary);
    background-color: var(--color-surface);
    border-radius: .5rem;
    padding: .5rem;
    transition: background-color .25s ease, border-color .25s ease;
    color: inherit;
}

a.news-item {
    background-color: var(--color-surface) !important;
}

    a.news-item:hover {
        background-color: var(--color-hover) !important;
        border-color: var(--color-primary) !important;
        color: inherit !important;
        text-decoration: none !important;
    }

.news-summary {
    font-size: .9rem;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    margin-top: 4px;
}

/* Pagination */
.page-item.active .page-link {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #fff !important;
    font-weight: 600;
}

.page-link {
    color: var(--color-primary);
    border-radius: 6px;
    transition: all .2s ease;
}

    .page-link:hover {
        background-color: var(--color-hover);
        color: var(--color-secondary) !important;
    }

/* Newsletter table no-hover */
.newsletter-table tbody tr:hover td,
.newsletter-table tbody tr:hover th {
    background-color: inherit !important;
    box-shadow: none !important;
    transform: none !important;
}

/* ============================================================
   LOGOS PER THEME
   ============================================================ */
.logo {
    height: 90%;
    max-height: 40px;
    display: none;
}

[data-theme="Light"] .logo-light {
    display: block;
}

[data-theme="Dark"] .logo-dark {
    display: block;
}

[data-theme="BlueGreen"] .logo-bluegreen {
    display: block;
}

/* Caption headings on bright backgrounds */
[data-theme="Light"] .carousel-caption h1,
[data-theme="Light"] .carousel-caption h2,
[data-theme="Light"] .carousel-caption h3,
[data-theme="Light"] .carousel-caption h4,
[data-theme="Light"] .carousel-caption h5,
[data-theme="Light"] .carousel-caption h6,
[data-theme="Light"] .footer h1,
[data-theme="Light"] .footer h2,
[data-theme="Light"] .footer h3,
[data-theme="Light"] .footer h4,
[data-theme="Light"] .footer h5,
[data-theme="Light"] .footer h6,
[data-theme="BlueGreen"] .carousel-caption h1,
[data-theme="BlueGreen"] .carousel-caption h2,
[data-theme="BlueGreen"] .carousel-caption h3,
[data-theme="BlueGreen"] .carousel-caption h4,
[data-theme="BlueGreen"] .carousel-caption h5,
[data-theme="BlueGreen"] .carousel-caption h6,
[data-theme="BlueGreen"] .footer h1,
[data-theme="BlueGreen"] .footer h2,
[data-theme="BlueGreen"] .footer h3,
[data-theme="BlueGreen"] .footer h4,
[data-theme="BlueGreen"] .footer h5,
[data-theme="BlueGreen"] .footer h6 {
    color: lightgrey !important;
}

[data-theme="Dark"] footer .form-control {
    background-color: #fff !important;
    color: #212529 !important;
    border-color: #ccc !important;
}

/* ============================================================
   LEADER CARD
   ============================================================ */
.leader-card {
    position: relative;
    height: 280px;
    cursor: pointer;
}

.leader-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,.65);
    height: 100%;
    transform: translateY(65%);
    transition: transform .5s ease, background .3s ease;
    overflow: hidden;
}

.leader-card:hover .leader-info {
    transform: translateY(0);
    background: rgba(0,0,0,.75);
}

.leader-info p {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 0;
}

    .leader-info p::-webkit-scrollbar {
        display: none;
    }

.leader-info p {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================================
   PROJECT PROGRESS CARDS
   ============================================================ */
.project-progress {
    border: 1px solid rgba(0,0,0,.1);
    transition: box-shadow .3s ease, transform .2s ease;
    background-color: var(--color-surface);
}

[data-theme="Light"] .project-progress,
[data-theme="BlueGreen"] .project-progress {
    border: 1px solid rgba(0,0,0,.1);
}

[data-theme="Dark"] .project-progress {
    border: 1px solid rgba(255,255,255,.1);
    background: #1e1e1e;
    color: #f1f1f1;
}

.project-progress:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

[data-theme="Dark"] .project-progress:hover {
    box-shadow: 0 4px 12px rgba(255,255,255,.1);
}

/* ============================================================
   CAROUSEL FLIP EFFECT
   ============================================================ */
.carousel-flip .carousel-item-next.carousel-item-start,
.carousel-flip .carousel-item-prev.carousel-item-end {
    transform: rotateX(0);
}

.carousel-flip .carousel-item-next,
.carousel-flip .active.carousel-item-end {
    transform: rotateX(-180deg);
}

.carousel-flip .carousel-item-prev,
.carousel-flip .active.carousel-item-start {
    transform: rotateX(180deg);
}

.carousel-flip .carousel-item {
    backface-visibility: hidden;
    transform-origin: center bottom;
    transition: transform .6s ease-in-out;
}

/* ============================================================
   PAGE BACKGROUNDS
   ============================================================ */
body[data-theme="Light"] {
    background: url('/img/backgrounds/landing-light.png') center/cover no-repeat fixed;
}

body[data-theme="Dark"] {
    background: url('/img/backgrounds/landing-dark.png') center/cover no-repeat fixed;
}

body[data-theme="BlueGreen"] {
    background: url('/img/backgrounds/landing-bluegreen.png') center/cover no-repeat fixed;
}

/* ============================================================
   TIMELINE & LIGHTBOX
   ============================================================ */
.timeline-page h2 {
    font-weight: 700;
}

.timeline {
    position: relative;
    /*margin-left: 24px;*/
    padding-left: 24px;
}

    .timeline::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        border-radius: 4px;
        background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
        opacity: .9;
    }

.tl-item {
    position: relative;
    padding-left: 16px;
    margin-bottom: 24px;
}

.tl-dot {
    position: absolute;

    top: 10px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,.05);
}

.tl-meta {
    font-size: .9rem;
    color: var(--color-secondary);
    margin-bottom: 8px;
}

.tl-date {
    font-weight: 600;
}

.tl-card {
    background: var(--color-bg, #fff);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
}

/* Grid gallery */
.tl-gallery {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 10px;
}

@media (max-width: 992px) {
    .tl-gallery {
        grid-template-columns: repeat(3,1fr);
    }
}

@media (max-width: 576px) {
    .tl-gallery {
        grid-template-columns: repeat(2,1fr);
    }
}

.tl-image-wrap {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: zoom-in;
    aspect-ratio: 4/3;
}

    .tl-image-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scale(1);
        transition: transform .3s ease;
    }

    .tl-image-wrap:hover img {
        transform: scale(1.2);
    }

.tl-hidden {
    display: none;
}

/* Lightbox */
.tl-lightbox[hidden] {
    display: none !important;
}

.tl-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: grid;
    place-items: center;
    z-index: 1050;
}

#tl-lightbox-img {
    max-width: min(92vw,1400px);
    max-height: 82vh;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,.5);
}

.tl-caption {
    margin-top: 40%;
    color: #fff;
    text-align: center;
    max-width: 90vw;
    font-size: .95rem;
    opacity: .9;
    position: inherit;
    background-color: #212121;
}

.tl-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .2s ease;
}

    .tl-btn:hover {
        background: rgba(255,255,255,.3);
    }

.tl-prev {
    left: 24px;
}

.tl-next {
    right: 24px;
}

.tl-close {
    top: 18px;
    right: 18px;
    transform: none;
    width: 40px;
    height: 40px;
    font-size: 28px;
}

.tl-count {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-weight: 600;
    background: rgba(0,0,0,.35);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .95rem;
}

/* ============================================================
   FORUM (Dark tune-up)
   ============================================================ */
[data-theme="Dark"] .accordion-item {
    background: #1e1e2f;
    border: 1px solid #2a2a3d;
    border-radius: 6px;
}

[data-theme="Dark"] .accordion-button {
    background: #2b2b3c;
    color: #f1f1f1;
}

    [data-theme="Dark"] .accordion-button:not(.collapsed) {
        background: #33334d;
        color: #fff;
        box-shadow: inset 0 -1px 0 rgba(255,255,255,.1);
    }

[data-theme="Dark"] .accordion-body {
    background: #252536;
    color: #ddd;
}

[data-theme="Dark"] .list-group-item {
    background: #2c2c3d;
    color: #eee;
    border-color: #3a3a4d;
}

    [data-theme="Dark"] .list-group-item a {
        color: #4ea3ff;
    }

        [data-theme="Dark"] .list-group-item a:hover {
            color: #82c0ff;
            text-decoration: underline;
        }

[data-theme="Dark"] .text-muted {
    color: #aaa !important;
}

[data-theme="Dark"] img {
    border: 0px solid #444;
}

/* Topic hover */
.topic-item {
    transition: background-color .2s ease;
    cursor: pointer;
}

body[data-theme="Light"] .topic-item:hover {
    background: #f0f0f0;
}

body[data-theme="Dark"] .topic-item:hover {
    background: #2a2a2a;
}

body[data-theme="BlueGreen"] .topic-item:hover {
    background: #e0f7f5;
}

/* ============================================================
   MISC
   ============================================================ */
.banner {
    background: url('/img/hero.jpg') center/cover no-repeat;
}

.border-theme {
    border: 1px solid var(--color-primary);
}

.timeline-img {
    transition: transform .3s ease;
}

    .timeline-img:hover {
        transform: scale(1.2);
    }

.theme-preview {
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    font-size: .8rem;
    background-color: var(--color-surface);
}

    .theme-preview .navbar-theme {
        background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
        font-weight: 600;
    }

    .theme-preview .footer {
        background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
        font-size: .75rem;
    }

.theme-card .btn[type="submit"] {
    width: auto !important;
    display: inline-block;
    align-self: center;
    padding: 0 1rem;
}

/* ============================================================
   BLUEGREEN SOFT SHADOW LOOK (áp cho BlueGreen, vẫn giữ radius 12px)
   ============================================================ */
[data-theme="BlueGreen"] .card,
[data-theme="BlueGreen"] .service-card,
[data-theme="BlueGreen"] .partner-item,
[data-theme="BlueGreen"] .project-progress,
[data-theme="BlueGreen"] .news-item,
[data-theme="BlueGreen"] .tl-card {
    background: #fff;
    box-shadow: 0 2px 18px 0 rgb(0 0 0 / 9%);
    -webkit-box-shadow: 0 2px 18px 0 rgb(0 0 0 / 9%);
    border-radius: 12px; /* dùng chung var(--radius) => 12px */
    border-color: transparent;
}

    [data-theme="BlueGreen"] .card .card-body {
        padding: 20px;
    }

/* ============================================================
   CAROUSEL EDGE CONTROLS (vàng nhạt, trong suốt nhẹ)
   ============================================================ */
#completedCarousel {
    position: relative;
}

    #completedCarousel .carousel-control-prev,
    #completedCarousel .carousel-control-next {
        opacity: 1;
        width: auto;
        transition: transform .15s ease, opacity .15s ease;
    }

    #completedCarousel .carousel-control-prev {
        left: -32px;
    }

    #completedCarousel .carousel-control-next {
        right: -32px;
    }

    #completedCarousel .carousel-control-prev-icon,
    #completedCarousel .carousel-control-next-icon {
        width: 3rem;
        height: 3rem;
        border-radius: 999px;
        background-color: rgba(255,236,179,.85);
        background-size: 1.25rem 1.25rem;
        box-shadow: 0 8px 22px rgba(0,0,0,.22);
        border: 1px solid rgba(0,0,0,.12);
    }

    #completedCarousel .carousel-control-prev:hover .carousel-control-prev-icon,
    #completedCarousel .carousel-control-next:hover .carousel-control-next-icon,
    #completedCarousel .carousel-control-prev:focus .carousel-control-prev-icon,
    #completedCarousel .carousel-control-next:focus .carousel-control-next-icon {
        background-color: rgba(255,236,179,.98);
        transform: scale(1.06);
        box-shadow: 0 10px 26px rgba(0,0,0,.28);
    }

[data-theme="Dark"] #completedCarousel .carousel-control-prev-icon,
[data-theme="Dark"] #completedCarousel .carousel-control-next-icon {
    border: 1px solid rgba(255,255,255,.25);
}

/* Generic for other carousels (e.g., banner) */
.carousel.edge-controls {
    position: relative;
}

    .carousel.edge-controls .carousel-control-prev,
    .carousel.edge-controls .carousel-control-next {
        opacity: 1;
        width: auto;
        transition: transform .15s ease, opacity .15s ease;
        z-index: 5;
    }

    .carousel.edge-controls .carousel-control-prev {
        left: -32px;
    }

    .carousel.edge-controls .carousel-control-next {
        right: -32px;
    }

    .carousel.edge-controls .carousel-control-prev-icon,
    .carousel.edge-controls .carousel-control-next-icon {
        width: 3rem;
        height: 3rem;
        border-radius: 999px;
        background-color: rgba(255,236,179,.85);
        background-size: 1.25rem 1.25rem;
        box-shadow: 0 8px 22px rgba(0,0,0,.22);
        border: 1px solid rgba(0,0,0,.12);
    }

    .carousel.edge-controls .carousel-control-prev:hover .carousel-control-prev-icon,
    .carousel.edge-controls .carousel-control-next:hover .carousel-control-next-icon,
    .carousel.edge-controls .carousel-control-prev:focus .carousel-control-prev-icon,
    .carousel.edge-controls .carousel-control-next:focus .carousel-control-next-icon {
        background-color: rgba(255,236,179,.98);
        transform: scale(1.06);
        box-shadow: 0 10px 26px rgba(0,0,0,.28);
    }

[data-theme="Dark"] .carousel.edge-controls .carousel-control-prev-icon,
[data-theme="Dark"] .carousel.edge-controls .carousel-control-next-icon {
    border: 1px solid rgba(255,255,255,.25);
}

@media (max-width: 576px) {
    .carousel.edge-controls .carousel-control-prev {
        left: -16px;
    }

    .carousel.edge-controls .carousel-control-next {
        right: -16px;
    }
}

/* ============================================================
   FORUM PREVIEW (thumb, clamp, badges, no overflow)
   ============================================================ */
.topic-title {
    max-width: 44ch;
}

.comment-snippet {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.bg-primary-subtle {
    background: rgba(0,102,153,.12) !important;
}

.bg-success-subtle {
    background: rgba(0,153,102,.12) !important;
}

.forum-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 40px;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

.topic-thumb {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex: 0 0 28px;
    margin-top: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.min-w-0 {
    min-width: 0 !important;
}

.forum-header .forum-badges {
    white-space: nowrap;
}

.card .badge {
    vertical-align: middle;
}

.badge {
    border-radius: 999px;
    padding: .35rem .6rem;
    font-weight: 600;
}

/* ============================================================
   UNIFIED SOFT-SHADOW & RADIUS (áp dụng cho leader/service/forum)
   ============================================================ */
.soft-shadow {
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid rgba(0,0,0,.04);
    box-shadow: var(--shadow-soft);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .soft-shadow:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-soft-hover);
    }

/* Bo góc đồng bộ (Light/Dark như BlueGreen) */
.leader-shell, .service-shell, .forum-card {
    border-radius: var(--radius);
}

    /* Bên trong không ghi đè */
    .leader-shell .leader-card,
    .service-shell .service-card {
        border-radius: inherit;
        overflow: hidden;
        background: transparent !important;
        border: 0 !important;
    }

/* Forum card dùng soft-shadow */
.forum-card {
    border: 1px solid rgba(0,0,0,.04);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .forum-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-soft-hover);
    }

/* BlueGreen giữ tone bóng airy nhưng bo góc vẫn 12px (đồng bộ) */
[data-theme="BlueGreen"] .soft-shadow,
[data-theme="BlueGreen"] .forum-card {
    background: #fff;
    border-color: transparent;
    box-shadow: 0 2px 18px 0 rgb(0 0 0 / 9%) !important;
    -webkit-box-shadow: 0 2px 18px 0 rgb(0 0 0 / 9%) !important;
}
/* ==== Timeline compact (Home) ==== */
.timeline--compact {
    position: relative;
    padding-left: 24px;
}

    .timeline--compact .tl-item {
        margin-bottom: 14px;
        padding-left: 0;
    }

        .timeline--compact .tl-item:last-child {
            margin-bottom: 0;
        }

.tl-item--compact .tl-dot {
  
    top: 10px;
    width: 12px;
    height: 12px;
    border: 3px solid var(--color-primary);
}

.tl-item--compact .tl-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tl-item--compact .tl-text {
    flex: 1 1 auto;
    min-width: 0;
}

.tl-item--compact .tl-title {
    font-weight: 700;
    color: var(--color-primary);
    display: inline-block;
    max-width: 52ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .tl-item--compact .tl-title:hover {
        text-decoration: underline;
    }

.tl-item--compact .tl-summary {
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.tl-item--compact .tl-cover {
    flex: 0 0 auto;
    width: 90px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,.08);
}

    .tl-item--compact .tl-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* mobile: thu nhỏ ảnh */
@media (max-width: 576px) {
    .tl-item--compact .tl-cover {
        width: 76px;
        height: 56px;
    }
}
/* Timeline */
.tl-line {
    position: relative;
}

    .tl-line::before {
        content: "";
        position: absolute;
        left: 20px;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--bs-border-color, #dee2e6);
    }

.tl-item {
    position: relative;
    /*padding-left: 40px;*/
    margin-bottom: 1.75rem;
}
.tl-item2 {
    position: relative;
    
    margin-bottom: 1.75rem;
}
.tl-dot {
    position: absolute;
    left:12px;
    top: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(13,110,253,.15);
}
.tl-dot2 {
    position: absolute;
    left: -31px;
    top: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(13,110,253,.15);
}

.tl-date {
    font-weight: 600;
    color: var(--bs-primary);
}

/* Photo grid + hover zoom */
.tl-photo-wrap {
    overflow: hidden;
    border-radius: .5rem;
    background: #00000010;
}

.tl-photo {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
    will-change: transform;
}

.tl-photo-wrap:hover .tl-photo {
    transform: scale(1.2);
}
/* ~20% */

/* LIGHTBOX */
.tl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(0,0,0,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

    .tl-lightbox.d-none {
        display: none;
    }

.tl-lightbox-inner {
    position: relative;
    max-width: min(96vw,1400px);
    max-height: 90vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tl-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: .5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
    background: #000;
}

.tl-lightbox .tl-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(2px);
    transition: background .2s ease, transform .1s ease;
}

    .tl-lightbox .tl-btn:hover {
        background: rgba(255,255,255,.3);
    }

    .tl-lightbox .tl-btn:active {
        transform: translateY(-50%) scale(.96);
    }

.tl-prev {
    left: -60px;
}

.tl-next {
    right: -60px;
}

/* Top controls */
.tl-topbar {
    position: absolute;
    top: -56px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    gap: 12px;
}

.tl-close {
    position: absolute;
    top: -56px;
    right: 0;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(2px);
}

.tl-counter {
    position: absolute;
    top: -56px;
    left: 0;
    color: #fff;
    font-weight: 600;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    padding: 6px 12px;
    border-radius: 999px;
    backdrop-filter: blur(2px);
}

/* Responsive: khi màn nhỏ, dời nút prev/next vào trong */
@media (max-width: 768px) {
    .tl-prev {
        left: 8px;
    }

    .tl-next {
        right: 8px;
    }

    .tl-topbar, .tl-close, .tl-counter {
        top: -44px;
    }
}
/* Hand cursor khi hover ảnh thumbnail */
.tl-photo {
    cursor: pointer;
}

/* Fallback: nếu không tải được ảnh, dùng zoom-in */
.tl-photo {
    cursor: url('/img/cursors/magnifier.cur') 8 8, zoom-in; /* .cur/.png đều được; 8 8 là hotspot */
}

.tl-lightbox #tlImg {
    cursor: pointer;
}
.likers-dropdown ul, .likers-dropdown li {
    display: block;
}

/* ==== Global media fixes (images/iframes on mobile) ==== */
img, video { max-width: 100%; height: auto; }
iframe { max-width: 100%; width: 100%; border: 0; }

/* Responsive map wrapper (use .map-responsive > iframe) */
.map-responsive { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.map-responsive iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Prevent edge controls from causing horizontal scroll on small screens */
@media (max-width: 768px) {
  .carousel.edge-controls .carousel-control-prev { left: 8px; }
  .carousel.edge-controls .carousel-control-next { right: 8px; }
}

/* Lightbox nav buttons: keep inside on small screens */
@media (max-width: 768px) {
  .tl-prev { left: 8px; }
  .tl-next { right: 8px; }
  .tl-topbar, .tl-close, .tl-counter { top: -44px; }
}

/* CompletedCarousel edge controls mobile clamp */
@media (max-width: 768px) {
  #completedCarousel .carousel-control-prev { left: 8px; }
  #completedCarousel .carousel-control-next { right: 8px; }
}

/* Fix potential container overflow */
.container, .container-fluid { overflow-x: clip; }


/* notification */
.right-cluster .dropdown-menu {
    min-width: 300px;
    max-width: 420px; /* NEW: tối đa 420px */
    width: 360px; /* NEW: mặc định 360px cho đẹp */
    white-space: normal; /* NEW: cho phép xuống dòng */
    word-break: break-word; /* NEW: cắt từ nếu quá dài */
}

/* Item thông báo gọn gàng, chống tràn */
.notif-item {
    display: block;
    padding: .5rem .75rem;
}

.notif-message {
    display: block;
    white-space: normal; /* xuống dòng */
    word-break: break-word;
}

/* Search box toggle */
#searchBox {
    display: none;
    transition: all .3s ease-in-out;
}

    #searchBox.show {
        display: block;
    }

/* Căn chỉnh cụm phải gọn gàng */
.right-cluster .nav-link, .right-cluster .btn {
    line-height: 1;
}

.right-cluster .dropdown-menu {
    min-width: 300px;
}

/* Badge số thông báo */
#notif-badge {
    min-width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
}
/* Fix nested dropdowns removed to fix conflicts */


       
 body[data-theme="Light"] .navbar-theme { background-color: #fff; }
        body[data-theme="Light"] .navbar-theme .nav-link { color: #333 !important; }
        body[data-theme="Light"] .navbar-theme .dropdown-menu { background-color: #fff; border: 1px solid #eee; }
        body[data-theme="Light"] .navbar-theme .dropdown-item { color: #333; }
        body[data-theme="Light"] .navbar-theme .dropdown-item:hover { background-color: #f8f9fa; }

        body[data-theme="Dark"] .navbar-theme { background-color: #1a1a1a; }
        body[data-theme="Dark"] .navbar-theme .nav-link { color: #fff !important; }
        body[data-theme="Dark"] .navbar-theme .dropdown-menu { background-color: #2d2d2d; border: 1px solid #444; }
        body[data-theme="Dark"] .navbar-theme .dropdown-item { color: #fff; }
        body[data-theme="Dark"] .navbar-theme .dropdown-item:hover { background-color: #3d3d3d; }

        /* === UNIQUE MENU EFFECTS === */
        
        .navbar-theme,
        #nav,
        .right-cluster {
            overflow: visible;
        }

        /* 1. Animated Underline for Nav Links */
        .navbar-theme .nav-link {
            position: relative;
            padding-bottom: 5px;
            transition: color 0.3s ease;
        }
        
        .navbar-theme .nav-link::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: 0;
            left: 50%;
            background-color: var(--color-primary, #0d6efd);
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bouncy effect */
            transform: translateX(-50%);
        }
        
        .navbar-theme .nav-link:hover::after {
            width: 80%;
        }

        @* /* 2. Dropdown Animation & Styling */
        .dropdown-menu {
            border: none;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            padding: 10px;
            margin-top: 200px !important; /* Spacing from navbar */
            min-width: 260px;
        } *@

        .dropdown-item {
            border-radius: 8px;
            padding: 8px 16px;
            transition: all 0.2s ease;
            font-weight: 500;
            white-space: nowrap;
        }

        .dropdown-item:hover {
            transform: translateX(5px);
            background-color: var(--color-hover, #f8f9fa);
            color: var(--color-primary, #0d6efd);
        }

/* Nested Dropdown Support & Animation removed to fix conflicts */

        /* Floating Buttons */
        .floating-container {
            position: fixed;
            bottom: 30px;
            right: 30px;
            z-index: 9999;
            display: flex;
            flex-direction: column-reverse;
            align-items: center;
        }

        .floating-group {
            display: flex;
            flex-direction: column;
            gap: 15px;
            align-items: center;
            margin-bottom: 0;
            transition: all 0.3s ease;
        }

        .floating-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 24px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            transition: all 0.3s;
            text-decoration: none;
            border: none;
            cursor: pointer;
            position: relative;
        }

        .floating-btn:hover { transform: scale(1.1); color: #fff; }
        
        .btn-call { background-color: #dc3545; }
        .btn-zalo { background-color: #fff; padding: 0; overflow: hidden; }
        .btn-zalo img { width: 100%; height: 100%; object-fit: cover; }
        .btn-chat { background-color: #28a745; }
        .btn-close-float { background-color: #28a745; font-size: 28px; }

        /* Pulse animation for the main toggle button */
        @keyframes pulse-green {
            0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
            70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
            100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
        }
        
        .btn-toggle-main {
            background-color: #28a745;
            animation: pulse-green 2s infinite;
        }
/* ============================================================
   MENU & DROPDOWN FIXES
   ============================================================ */

/* 1. Root Dropdown (Level 1) */
/* Note: The menu is wrapped in a div inside the li */
.navbar-nav .nav-item.dropdown > div > .dropdown-menu {
    top: 100%;
    margin-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    border: none;
    box-shadow: var(--shadow-md);
    display: none;
    overflow: visible !important; /* Ensure nested menus are not clipped */
}

/* 2. Nested Dropdowns (Level 2+) */
.dropdown-menu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -5px;
    margin-left: 0;
    border-radius: var(--radius);
    display: none;
    position: absolute;
    box-shadow: var(--shadow-md);
    background-color: #fff; /* Ensure background is set */
    min-width: 200px; /* Ensure it has width */
}

/* Ensure list items are relative */
.dropdown-menu li {
    position: relative;
}

/* 3. Hover Behavior (Desktop) */
@media (min-width: 992px) {
    /* Show Level 1 */
    .navbar-nav .nav-item.dropdown:hover > div > .dropdown-menu {
        display: block;
        animation: fadeInUp 0.3s ease forwards;
    }

    /* Show Level 2+ */
    .dropdown-menu > li:hover > .dropdown-menu {
        display: block;
        animation: fadeInUp 0.3s ease forwards;
    }

    /* Bridge for Root Item */
    .navbar-nav .nav-item.dropdown::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 20px;
        transform: translateY(50%);
        z-index: 10;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 15px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Mobile Adjustments */
@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
        display: none; /* Bootstrap handles toggle via JS click */
    }
    
    .navbar-nav .dropdown-menu.show {
        display: block;
    }
}


/* Clean split button */
.navbar-nav .dropdown-toggle-split {
    border: none;
    background: none;
    box-shadow: none !important;
}

