@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

html, body {
    margin: 0;
    padding: 0; 
    width: 100%;
    overflow-x: hidden;
    background-color: #ffffff;   
}

/* PAGE WRAPPER ============================================*/
.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Phần header ============================================*/
header {
    display: flex;
    background-image: url('/logo/header.jpg');
    background-size: cover; 
    background-position: center;
    background-repeat: no-repeat;
    margin: 0;
    padding: 5px;
    align-items: center;
}
#anhlogodoan {
    display: flex;
    width: 90px;
    justify-content: center;
    align-items: center;
}
#logo {
    padding-left: 10px;
    width: 90px;
    padding-top: 5px;
    margin-right: 50px;
    display: block;
    justify-content: center;
    align-items: center;
}
#namelogo {
    font-family: sans-serif;
    color: white;
    text-align: center;
    margin-top: 5px;
    font-size: 10px;
    font-weight: 700;
}
#ntlg {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center; 
}
#nametag h1 {
    font-family: sans-serif;
    color: white;
    margin-top: 5px;
    margin-bottom: 16px;
}
#nametag p {
    font-family: sans-serif;
    color: white;
    margin-bottom: 0;
}
#imglogo img {
    width: 200px;
    margin: 0;
}

/* SEARCH BAR ===============================================================================*/
.search-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 20px auto;
    flex-wrap: wrap;
    width: 90%;
    max-width: 1000px;
    padding: 0 20px;
    box-sizing: border-box;
}
.search-bar input,
.search-bar select {
    padding: 10px 14px;
    border: 2px solid #1931A7 ; 
    border-radius: 8px;
    font-size: 1em;
    outline: none;
    box-sizing: border-box;
}
.search-bar input {
    flex: 1;
    min-width: 220px;
}
input:focus {
    box-shadow: 0 0 10px #1931A7 ;
}

.custom-select {
    position: relative;
    width: 220px;
    font-family: "Montserrat", sans-serif;
    user-select: none;
}
.custom-select .selected {
    padding: 10px 14px;
    border: 2px solid #1931A7 ;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}
.custom-select .selected::after {
    content: "▼";
    font-size: 12px;
    color: #1931A7 ;
    margin-left: 8px;
    transition: transform 0.2s;
}
.custom-select.active .selected::after {
    transform: rotate(180deg);
}
.custom-select .options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 2px solid #ffffff;
    border-radius: 8px;
    background: #fff;
    margin-top: 4px;
    z-index: 10;
    box-shadow: 0 4px 10px #1931A7 ;
    animation: slideDown 0.15s ease;
    overflow: hidden;
}
.custom-select.active .options {
    display: block;
}
.custom-select .options div {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.custom-select .options div:hover {
    background: #1931A7 ;
    color: #fff;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* CARD ===============================================================================*/
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, 300px);
    gap: 25px;
    padding: 20px;
    justify-content: center; 
    max-width: 1340px;
    margin: 0 auto;
    align-items: flex-start;
}
.card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    width: 300px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.852);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 3px solid #1931A7 ;
    position: relative; /* needed for ::before / ::after */
}
.card::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    margin-left: -300px;
    margin-top: -300px;
    border-radius: 50%;
    z-index: -2;
    background: #e0e0e0;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.card:hover::before {
    opacity: 1;
    background: conic-gradient(transparent, transparent, transparent, #0011ff, #30b0ff);
    animation: rotate 4s linear infinite;
}
/* FIX 4.1: 'form' → 'from' */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.card::after {
    content: "";
    position: absolute;
    inset: 5px;
    background: #ffffff;
    border-radius: 10px;
}
.card-img {
    position: relative;
    margin: 5px 5px 0 5px;
    z-index: 2;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}
.card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px 10px 0 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.card-img img.active,
.card-img img:only-child {
    opacity: 1;
    z-index: 3;
}

.full-info{
    font-family: "Montserrat", sans-serif;
    margin-bottom: 10px;
}

/* Dot indicator for slideshow */
.dot-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 4;
}
.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: background 0.3s;
}
.dot.active {
    background: #fff;
}

.card-text {
    padding: 20px;
    padding-bottom: 0;
    flex: 1;
    margin-left: 5px;
    margin-right: 5px;
    z-index: 2;
}
.card-text h3 {
    font-family: "Montserrat", sans-serif;
    font-weight: 900;
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #1931A7 ;
    text-align: center;

    min-height: 42px; 
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-text p{
    text-align: center;
}
.card-text p, .short-info {
    font-size: 14px;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    color: #1931A7;
    margin: 0 0 10px 0;

    min-height: 36px; 
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* FIX 5.1: Differentiate primary vs secondary button */
.card-footer {
    padding: 0 15px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 10;
}

/* Primary button — solid red */
.card-footer a.map-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: #1931A7 ;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-family: "Montserrat", sans-serif;
    font-weight: 900;
    box-sizing: border-box;
    transition: background 0.3s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}
.card-footer a.map-btn:hover {
    background: rgb(242, 255, 0);
    color: #1931A7 ;
    transform: scale(1.05);
    box-shadow: 0 0 12px #1931A7 ;
}
.card-footer a.map-btn:active {
    transform: scale(0.95);
}
.map-btn::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    top: 0;
    left: 0;
    opacity: 0;
    transform: scale(0);
    border-radius: inherit;
    transition: transform 0.4s, opacity 0.8s;
}
.map-btn:active::after {
    opacity: 1;
    transform: scale(2);
    transition: 0s;
}

/* Secondary button — ghost/outline style */
.view-img-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: transparent;
    color: #1931A7 ;
    border: 2px solid #1931A7 ;
    font-family: "Montserrat", sans-serif;
    font-weight: 900;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    box-sizing: border-box;
}
.view-img-btn:hover {
    background: #1931A7 ;
    color: #fff;
}

/* Stacking context fix for card children */
.card-img,
.card-text {
    position: relative;
    z-index: 10;
}

/* ===================================================
   SEARCH SUGGESTIONS (GỢI Ý TÌM KIẾM)
   =================================================== */
.suggestions-box {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1000px; /* Bằng với max-width của search-bar */
    background: #ffffff;
    border: 2px solid #1931A7;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 5px;
}
.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    color: #1931A7;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}
.suggestion-item:last-child {
    border-bottom: none;
}
.suggestion-item:hover {
    background-color: #1931A7;
    color: #ffffff;
}
/* ===================================================
   PAGINATION (PHÂN TRANG)
   =================================================== */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px auto 40px auto;
    flex-wrap: wrap;
}
.page-btn {
    padding: 8px 14px;
    border: 2px solid #1931A7;
    background: #ffffff;
    color: #1931A7;
    border-radius: 6px;
    cursor: pointer;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    transition: all 0.3s;
}
.page-btn:hover {
    background: #1931A7;
    color: #ffffff;
}
.page-btn.active {
    background: #1931A7;
    color: #ffffff;
}

/* Modal CSS ===============================================================================*/
.modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}
.modal-container { text-align: center; }
.modal-content {
    max-width: 80vw;
    max-height: 80vh;
    border: 3px solid #fff;
    border-radius: 10px;
}
.close-modal {
    position: absolute;
    top: 20px; right: 35px;
    color: #fff; font-size: 40px; cursor: pointer;
}
.modal-prev,
.modal-next {
    background: rgba(23, 38, 173, 0.7);
    color: #fff;
    border: none;
    font-size: 28px;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 10002;
}
.modal-prev:hover,
.modal-next:hover {
    background: #1931A7 ;
}

/* VIDEO SECTION ============================================*/
.video-section {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, #1931a7be  0%, #ffffff 80%);
    overflow: hidden;
}
.video-player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background-color: #000;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
}
.video-player-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}
#custom-mute-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(23, 35, 173, 0.85);
    color: white;
    border: 2px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    pointer-events: auto;
    transition: 0.3s;
}
.scroll-down-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 24px;
    cursor: pointer;
    animation: bounce 2s infinite;
    z-index: 10;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40%  { transform: translateY(-10px) translateX(-50%); }
    60%  { transform: translateY(-5px)  translateX(-50%); }
}

/* FOOTER ===============================================================================*/
footer {
    display: flex;
    margin-top: 50px;
    background: #0f0f0fc1;
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    backdrop-filter: blur(6px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.507);
}
footer #tonglienlac {
    width: 400px;
    margin-top: 10px;
    padding-bottom: 10px;
    padding-top: 20px;
}
footer .lienlac {
    display: flex;
    gap: 8px;
    margin: 5px;
}
footer p {
    text-align: left;
    margin: 10px;
    margin-top: 0;
    margin-bottom: 15px;
}
footer .lienlac a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    font-family: "Montserrat", sans-serif;
}
footer .lienlac img { border-radius: 100%; }
footer .lienlac a:hover { color: #ffd700; }

#logofooter {
    margin-top: 20px;
    width: 100%;
    padding-left: 10px;
    padding-top: 5px;
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ffffff;
}
#textlogof {
    display: flex;
    font-family: "Montserrat", sans-serif;
    align-items: center;
}
#textlogof h3 {
    font-size: 30px;
    margin: 0 0 0 10px;
}
#logofooter p {
    margin: 0;
    margin-top: 5px;
    margin-bottom: 10px;
    text-align: left;
    font-family: "Montserrat", sans-serif;
}
#Thongtincoban { display: block; }
#in4 {
    display: flex;
    width: 100%;
    justify-content: space-between;
}
#in4 img {
    width: 350px;
    height: 300px;
    object-fit: cover;
    -webkit-mask-image:
        linear-gradient(to right,  transparent, black 5%, black 95%, transparent),
        linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    -webkit-mask-composite: intersect;
    mask-image:
        linear-gradient(to right,  transparent, black 5%, black 95%, transparent),
        linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    mask-composite: intersect;
}
#ThongtinF {
    width: 500px;
    margin-left: 100px;
    font-family: "Montserrat", sans-serif;
    font-weight: 900;
    text-align: left;
}
#ThongtinF h2 { margin-bottom: 10px; }
#ThongtinF a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    margin-bottom: 10px;
    margin-top: 5px;
    font-family: "Montserrat", sans-serif;
}
#ThongtinF a:hover { color: #ffd700; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1280px) {
    #in4 {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    #in4 img {
        width: 100%;
        max-width: 650px;
        margin-left: 0;
        margin-top: 20px;
        align-self: center;
        box-sizing: border-box;
    }
    /* Disable rotating border animation on touch/mid-range devices */
    .card::before,
    .card::after {
        display: none !important;
        content: none !important;
    }
    .card:hover::before {
        display: none !important;
        opacity: 0 !important;
    }
}

@media (max-width: 1024px) {
    #in4 img { max-width: 400px; }
    #ThongtinF h2 { font-size: 15px; }
}

@media (max-width: 789px) {
    .video-player-container iframe {
        transform: translate(-50%, -50%) scale(1) !important;
    }
    header { padding: 10px; }
    #logo {
        margin-right: 15px;
        padding-left: 5px;
        padding-top: 0;
        margin-bottom: 0;
    }
    #logo img { width: 45px; }
    #namelogo { font-size: 8px; text-align: center; }
    #ntlg { flex-direction: row; align-items: center; width: 100%; }
    #nametag { flex: 1; }
    #nametag p { font-size: 12px; margin-bottom: 4px; }
    #nametag h1 { font-size: 20px; margin: 0; }
    #imglogo img { width: 100px; }

    /* FIX 4.2: replace hardcoded margin-left with auto centering */
    .search-bar {
        margin: 10px auto;
        flex-direction: column;
        width: 90%;
        padding: 0;
    }
    .search-bar input,
    .custom-select {
        width: 100%;
        min-width: 0;
    }

    footer,
    #in4 {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    #in4 { flex-direction: column-reverse; }
    #tonglienlac,
    #ThongtinF,
    #in4 img {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        box-sizing: border-box;
    }
    #in4 img {
        margin-top: 20px;
        align-self: center;
        max-width: 800px;
    }
}

@media (max-width: 496px) {
    header { padding: 8px; }
    #logo { margin-right: 10px; }
    #nametag p { font-size: 8px; font-weight: 600; }
    #nametag h1 { font-size: 15px; }

    .card-container { 
        grid-template-columns: 1fr;
        padding: 10px; 
    }
    .card {
        width: 95%;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }

    .search-bar {
        margin: 10px auto;
        flex-direction: column;
        width: 90%;
        padding: 0;
    }
    .search-bar input,
    .custom-select {
        width: 100%;
        min-width: 0;
    }

    .card-container { padding: 10px; }
    .card {
        width: 95%;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }

    #ThongtinF h2 { font-size: 18px; }
    #tonglienlac a { font-size: 12px; }
}

/* FIX 4.2 / FIX unusual 429px breakpoint:
   merged into ≤480px above; kept only truly phone-specific tweaks */
@media (max-width: 429px) {
    header { padding: 8px 6px; }
    #logo { width: 50px; margin-right: 8px; }
    #anhlogodoan { width: 50px; }
    #logo img { width: 40px; }
    #namelogo { font-size: 6px; }
    #nametag p { font-size: 7px; font-weight: 600; }
    #nametag h1 { font-size: 13px; }
    #ThongtinF h2 { font-size: 15px; }
    #ThongtinF a { font-size: 12px; }
    #tonglienlac a { font-size: 11px; }
}
