@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;   
}
/* Phần header ============================================*/
header{
    display: flex;
    background-image: url('/logo/header.png');
    background-size: cover; 
    background-position: center;
    background-repeat: no-repeat;
    margin: 0px;
    padding: 5px;
    align-items: center;
}
#anhlogodoan{
    display: flex;
    width: 90px;
    justify-content: center;
    align-items: center;
}
/* Logo (cả chữ) */
#logo{
    padding-left: 10px;
    width: 90px;
    padding-top: 5px;
    margin-right: 50px;
    display: block;
    justify-content: center;
    align-items: center;
}
/* Chữ dưới logo */

#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: 0px;
}
#imglogo img{
    width: 200px;
    margin: 0px;
}

/* 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 #ad171c; 
  border-radius: 8px;
  font-size: 1em;
  outline: none;
}
.search-bar input {
  flex: 1;
  min-width: 220px;           
}
input:focus {
  box-shadow: 0 0 10px #ad171c;
}

.custom-select {
  position: relative;
  width: 220px;
  font-family: "Segoe UI", sans-serif;
  user-select: none;
}

.custom-select .selected {
  padding: 10px 14px;
  border: 2px solid #ad171c;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-select .selected::after {
  content: "▼";
  font-size: 12px;
  color: #ad171c;
  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 #ad171c;
  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: #ad171c;
  color: #fff;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CARD ===============================================================================*/
.card-container {
  display: flex;
  gap: 20px;
  padding: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.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 #ad171c; 
}
.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, #ff0000, #ff8d30);
    animation: rotate 4s linear infinite;
}
@keyframes rotate {
    form{
        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; /* Đưa tỷ lệ khung hình lên container chính */
    overflow: hidden;   /* Giấu phần ảnh bị tràn */
    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;
    
    /* Ẩn tất cả ảnh đi kèm hiệu ứng mờ dần (fade) */
    opacity: 0; 
    transition: opacity 1s ease-in-out;
}
.card-img img.active,
.card-img img:only-child {
    opacity: 1;
    z-index: 3;
}

.card-text {
    padding: 20px;
    padding-bottom: 0;
    flex: 1;
    margin-left: 5px;
    margin-right: 5px;
    z-index: 2;
}.card-text h3 {
    font-family: "Montserrat";
    font-weight: 900;
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #ad171c;
}
.card-text p {
    font-size: 14px;
    font-family: "Montserrat";
    font-weight: 700;
    color: #ad171c;
}

.card-footer {
    padding: 0 15px 15px 15px; /* Thêm padding để nút không chạm viền */
    display: flex;
    flex-direction: column;
    gap: 8px; /* Khoảng cách giữa 2 nút */
}
.view-img-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background-color: #ad171c; /* Đỏ như map-btn */
    color: white;
    font-family: "Montserrat";
    font-weight: 900;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.view-img-btn:hover {
    background-color: #f2ff00;
    color: #ad171c;
}
/* 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;
}


@keyframes zoom {
    from {transform: scale(0)} to {transform: scale(1)}
}

.close-modal {
    position: absolute;
    top: 20px; right: 35px;
    color: #fff; font-size: 40px; cursor: pointer;
}
.card-footer a {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: #ad171c;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-family: "Montserrat";
    font-weight: 900;
    box-sizing: border-box;
    transition: background 0.3s ease; 
}
.card-footer a:hover {
  background: rgb(242, 255, 0);
  color: #ad171c;
}
.card-img, .card-text, .card-footer {
    position: relative; 
    z-index: 10;
}

.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;   
}

/* Hover - sáng hơn + phóng to nhẹ */
.map-btn:hover {
  background: #ad171c;
  transform: scale(1.05);
  box-shadow: 0 0 12px #ad171c;
}
/* Active - thu nhỏ + đậm hơn */
.map-btn:active {
  transform: scale(0.95);
  background: #ad171c;
}


/* FOOTER =================================================================================================*/
footer {
    display: flex;
    margin-top: 50px;
    background: #0f0f0fc1;
    color: #fff;
    text-align: center;
    padding: 10px 10px;
    font-size: 14px;
    backdrop-filter: blur(6px);
    box-shadow: 0px 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: 0px;
    margin-bottom: 15px;
}
footer .lienlac a {
  display: flex;
  align-items: center;
  gap: 6px;              
  text-decoration: none; 
  color: #fff;           
  font-weight: bold;
  font-family: "Montserrat";
}
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: 0px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ffffff;
}
#textlogof{
    display: flex;
    font-family: "Montserrat";
    align-items: center;
}
#textlogof h3{
    font-size: 30px;
    margin: 0px;
    margin-left: 10px;
}
#logofooter p{
    margin: 0px;
    margin-top: 5px;
    margin-bottom: 10px;
    text-align: left;
    font-family: "Montserrat";
}
#Thongtincoban{
    display: block  ;
}
#in4{
    display: flex;
    width: 100%;
    justify-content: space-between;
    
}
#in4 img{
    width: 400px;
    height: 300px;
    object-fit: cover;
    /* Tạo dải mờ từ trái sang phải và từ trên xuống dưới */
    -webkit-mask-image: 
        linear-gradient(to right, transparent, black 5%, black 95%, transparent),
        linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    
    /* Kết hợp 2 dải mờ trên */
    -webkit-mask-composite: intersect; 

    /* Thuộc tính chuẩn (lặp lại) */
    mask-image: 
        linear-gradient(to right, transparent, black 5%, black 95%, transparentt),
        linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    mask-composite: intersect;
}
#ThongtinF{
    width: 500px;
    margin-left: 100px;
    font-family: "Montserrat";
    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";
}
#ThongtinF a:hover {
  color: #ffd700;        
}

#last{
    background-color: #000000e1;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ffffff;
    font-family: "Montserrat";
    font-weight: 700;
    padding: 20px;
}

/* VIDEO SECTION ============================================*/
.video-section {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to bottom, #ad171c 0%, #ffffff 80%);
  overflow: hidden;
}

.video-player-container {
position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Tỷ lệ 16:9 (9 / 16 = 0.5625) */
    height: 0;
    overflow: hidden;
    background-color: #000; /* Hiển thị màu đen khi video đang tải */
    /* Tạo dải mờ ở trên và dưới */
    -webkit-mask-image: 
        linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
    
    /* Thuộc tính chuẩn (lặp lại) */
    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%);
    width: 100%;
    height: 100%;
    border: none;
    /* Dòng này để không cho tua hay bấm vào video */
    pointer-events: none; 
}

.video-wrapper video {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}


.video-wrapper::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 25%;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
  pointer-events: none;
}

#ThongtinF .audio-player-container {
  align-items: center;
  margin-top: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* Trình phát âm thanh */
#ThongtinF .audio-player-container audio {
  flex: 1;
  margin-top: 5px;
  min-width: 350px;
  height: 40px; 
  font-family: "Montserrat";
}

/* =================================================== */
/* === (VIẾT LẠI) TOÀN BỘ CSS CHO ÂM NHẠC ĐỊA PHƯƠNG === */
/* =================================================== */

/* 0. HỦY BỎ NÚT BẤM CŨ (không dùng nữa) */
#ThongtinF .song-title-trigger {
    display: none;
}

/* 1. NÚT BẤM H2 VÀ MŨI TÊN */
#ThongtinF .audio-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
}
#ThongtinF .audio-toggle-btn h2 {
    margin-bottom: 0px;
}

/* (CẬP NHẬT) Thay thế mũi tên '▼' bằng tam giác CSS */
#ThongtinF .audio-toggle-btn .arrow-icon {
    content: '';
    width: 0; 
    height: 0; 
    
    /* Vẽ hình tam giác */
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #fff; /* Đây là mũi tên trỏ xuống */
  
    
    /* Hủy bỏ style text cũ */
    font-size: 0;
    line-height: 0;
    
    transform: translateY(12px);
    transition: transform 0.2s ease;
}

/* Khi bấm (JS thêm class 'active') */
#ThongtinF .audio-toggle-btn.active .arrow-icon {
    /* Xoay 180 độ để trỏ lên */
    transform: translateY(12px) rotate(180deg); 
}

/* Hiệu ứng hover (đổi màu cả H2 và mũi tên) */
#ThongtinF .audio-toggle-btn:hover h2 {
    color: #ffd700;
}
#ThongtinF .audio-toggle-btn:hover .arrow-icon {
    border-top-color: #ffd700; /* Đổi màu mũi tên */
}

/* 2. KHUNG DANH SÁCH BÀI HÁT (bị ẩn) */
#ThongtinF .song-list-container {
    display: none; /* Ban đầu ẩn */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    max-width: 350px;
    box-sizing: border-box;
}
/* Từng bài hát trong danh sách */
#ThongtinF .song-item {
    font-family: "Montserrat";
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
#ThongtinF .song-item:hover {
    color: #000000; 
    background: #ffd700;
}


/* 3. KHUNG PLAYER CHÍNH (MÀU XANH) */
#ThongtinF .player-wrapper {
    display: none; /* Ban đầu ẩn, JS sẽ đổi thành 'flex' */
    flex-direction: column; /* Xếp 2 hàng (header và control) */
    
    background: #0f0f0f89; /* Nền xanh đậm */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    
    padding: 10px;
    margin-top: 5px;
    min-width: 350px;
    max-width: 80%; /* Thêm cho responsive */
    box-sizing: border-box;
}

/* 3.1. Hàng 1 (Tên bài hát + Nút X) */
#ThongtinF .player-header {
    display: flex;
    justify-content: space-between; /* Đẩy 2 item ra 2 bên */
    align-items: center;
    margin-bottom: 10px; /* Cách thanh control bên dưới */
}

/* 3.2. Tên bài hát (Hàng 1, bên trái) */
#ThongtinF .current-player-title {
    color: #ffffff; /* Màu vàng */
    font-family: "Montserrat";
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    text-align: left;
    
    /* Chống tràn chữ */
    flex: 1; /* Cho phép co giãn */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px; /* Cách nút X 1 chút */
}

/* 3.3. Nút X (Hàng 1, bên phải) */
#ThongtinF .audio-close-btn {
    color: #fff; /* Màu trắng */
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    
    /* Reset/Hủy style cũ (nếu có) */
    position: static;
    background: none;
    border: none;
    border-radius: 0;
    width: auto;
    height: auto;
    display: inline;
}
#ThongtinF .audio-close-btn:hover {
    color: #ffd700;
    transform: scale(1.1);
    background: none; /* Đảm bảo không dính nền cũ */
}




/* ===================================================
   RESPONSIVE - Dành cho nhiều thiết bị (PHIÊN BẢN HOÀN CHỈNH)
   =================================================== */
@media (max-width: 1280px){
  #in4 {
        flex-direction: column; /* Xếp dọc */
        align-items: flex-start;
        text-align: left;
    }
    #in4 img {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        box-sizing: border-box;
    }
    #in4 img {
        margin-top: 20px;
        align-self: center;
        max-width: 650px;
    }
    .card::before {
        display: none !important; 
        animation: none !important; 
        content: none;            
        background: none; 
        width: 0 !important;
        height: 0 !important;
    
    }
    .card::after {
        display: none !important;
        content: none !important;
    }
    
    .card:hover::before {
        display: none !important;
        opacity: 0 !important;
    }
}
@media (max-width: 1024px){
  #in4 img {
        margin-top: 20px;
        align-self: center;
        max-width: 400px;
    }
    #ThongtinF h2{
      font-size: 15px;
    }
}
/* === 1. CHO MÁY TÍNH BẢNG (768px trở xuống) === */
/* Áp dụng cho màn hình từ 768px trở xuống */
@media (max-width: 768px) {
    
    /* --- Header --- */
    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; /* Cỡ chữ Lớn */
        margin-bottom: 4px;
    }
    #nametag h1 {
        font-size: 20px; /* Cỡ chữ Lớn */
        margin: 0;
    }
    #imglogo img{
        width: 100px;
    }

    /* --- Thanh tìm kiếm --- */
    .search-bar {
        margin-left: 60px;
        flex-direction: column; /* Xếp dọc */
        width: 80%;
    }
    .search-bar input,
    .custom-select {
        width: 100%; /* Chiếm 100% chiều rộng */
        min-width: 0;
    }

    /* --- Footer --- */
    footer,
    #in4 {
        flex-direction: column; /* Xếp dọc */
        align-items: flex-start;
        text-align: left;
    }
    #in4 {
        flex-direction: column-reverse; /* Đảo thứ tự ảnh và thông tin */
    }
    #tonglienlac,
    #ThongtinF,
    #in4 img {
        width: 100%; /* Chiếm 100% chiều rộng */
        max-width: 100%;
        margin-left: 0;
        box-sizing: border-box;
    }
    #in4 img {
        margin-top: 20px;
        align-self: center;
        max-width: 800px;
    }
}
#ThongtinF .song-title-trigger {
    font-family: "Montserrat";
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    
    /* Tạo hình dạng giống cái nút */
    display: inline-block; /* Quan trọng để áp dụng padding */
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1); /* Hơi trong suốt */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    
    transition: all 0.2s ease;
}

/* Hiệu ứng khi di chuột qua */
#ThongtinF .song-title-trigger:hover {
    color: #ffd700; /* Đổi màu vàng giống các link khác */
    background: rgba(255, 255, 255, 0.2);
}

/* Style cho trình phát nhạc khi nó hiện ra.
  Chúng ta dùng lại style cũ của bạn và đảm bảo nó 
  hiển thị dạng 'block' để chiếm một hàng.
*/
#ThongtinF #localAudioPlayer {
    flex: 1;
    margin-top: 5px;
    min-width: 350px;
    height: 40px; 
    font-family: "Montserrat";
}


/* === 2. TINH CHỈNH CHO ĐIỆN THOẠI VỪA (480px trở xuống) === */
/* Áp dụng cho màn hình từ 480px trở xuống */
@media (max-width: 480px) {
    header {
        padding: 8px;
    }
    #logo {
        margin-right: 10px;
    }
    #nametag p {
        font-size: 8px;  /* Cỡ chữ Vừa (~12px) */
        font-weight: 600;
    }
    #nametag h1 {
        font-size: 16px; /* Cỡ chữ Vừa (~16px) */
    }
    .search-bar {
        margin-left: 30px;
        flex-direction: column; /* Xếp dọc */
        width: 80%;
    }
    .search-bar input,
    .custom-select {
        width: 100%; /* Chiếm 100% chiều rộng */
        min-width: 0;
    }
    
    /* --- Cards --- */
    .card-container {
        padding: 10px;
    }
    .card {
        width: 95%; /* Các thẻ tự xếp thành 1 cột */
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }

    /* --- Footer Audio --- */
    #ThongtinF .audio-player-container {
        flex-direction: column; 
        align-items: stretch; 
    }
    #ThongtinF h2{
      font-size: 18px;
    }
    #tonglienlac a{
      font-size: 12px;
    }
}

/* === 3. TINH CHỈNH CHO ĐIỆN THOẠI HẸP (430px trở xuống) === */
/* Áp dụng cho màn hình 430px và TẤT CẢ các màn hình nhỏ hơn
   (Giải quyết vấn đề "không ăn khớp")
*/
@media (max-width: 429px) {
    header {
        padding: 8px 6px; /* Giảm đệm ngang */
    }
    .search-bar {
        margin-left: 20px;
        flex-direction: column; /* Xếp dọc */
        width: 80%;
    }
    .search-bar input,
    .custom-select {
        width: 100%; /* Chiếm 100% chiều rộng */
        min-width: 0;
    }
    
    /* Thu nhỏ logo */
    #logo {
        width: 50px;
        margin-right: 8px; /* Giảm lề */
    }
    #anhlogodoan{
        width: 50px;
    }
    #logo img {
        width: 40px; /* Thu nhỏ logo */
    }
    #namelogo {
        font-size: 6px; /* Chữ "XÃ ĐẦM HÀ" siêu nhỏ */
    }

    /* Thu nhỏ chữ tiêu đề */
    #nametag p {
        font-size:7px;  /* Cỡ chữ Rất nhỏ (~10.4px) */
        font-weight: 600; /* Vẫn giữ đậm để dễ đọc */
    }
    #nametag h1 {
        font-size: 13px; /* Cỡ chữ Rất nhỏ (~14.4px) */
    }
    #ThongtinF h2{
      font-size: 15px;
    }
    #ThongtinF a{
      font-size: 12px;
    }
    #tonglienlac a{
      font-size: 11px;
    }
}
