/* Giữ lại các style cũ cho body, header, map-container... */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Be Vietnam Pro', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background-color: #ffffff;
    padding: 15px 40px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.nav-link {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    padding: 10px 18px;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link:hover {
    background-color: #007bff;
    color: #ffffff;
}

/* Sửa lại .map-container, bỏ position: relative */
.map-container {
    flex: 1;
    position: relative;
    /* GIỮ NGUYÊN HOẶC BỎ ĐI ĐỀU ĐƯỢC */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px;
}

/* THÊM MỚI: Style cho div bao quanh ảnh */
.map-wrapper {
    position: relative;
    /* QUAN TRỌNG: Đây sẽ là gốc cho các ghim */
    max-width: 100%;
    max-height: 100%;
    line-height: 0;
    /* Giúp loại bỏ khoảng trắng thừa dưới ảnh */
    aspect-ratio: 735/ 724; /* Giữ tỉ lệ ảnh trên điện thoại di động */
}

/* Sửa lại .map-image */
.map-image {
    width: 100%;
    /* Ảnh phải luôn đầy 100% wrapper */
    height: auto;
    display: block;

    /* Các thuộc tính max- bị di chuyển lên .map-wrapper */
    /* XÓA: max-width: 100%; */
    /* XÓA: max-height: 100%; */
}

.map-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px;
}

.map-image {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    display: block;
}

/* --- PHẦN STYLE MỚI --- */

/* Ghim vị trí */
.location-pin {
    position: absolute;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transform: translate(-50%, -50%);
    /* Căn tâm của ghim vào đúng tọa độ */
    transition: transform 0.2s ease-in-out;
}

.location-pin img {
    width: 100%;
    pointer-events: none;
    /* Giúp click xuyên qua ảnh để nhận diện pin */
}

.location-pin:hover {
    transform: translate(-50%, -50%) scale(1.3);
    /* Phóng to khi hover */
    z-index: 10;
}

/* Tooltip (tên vị trí) */
.tooltip {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.location-pin:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Trang thông tin chi tiết (dạng modal) */
.detail-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: none;
    /* Ẩn mặc định */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.detail-section.visible {
    display: flex;
    /* Hiện khi có class 'visible' */
}

.detail-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    position: relative;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);

    /* Thiết lập Flexbox để chia bố cục theo chiều dọc */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Giấu phần thừa ở cấp cao nhất */
}

/* THÊM MỚI khối CSS này */
.scrollable-content {
    padding: 30px;
    overflow-y: auto;
    /* Chỉ cho phép khu vực này cuộn */
    flex: 1;
    /* Quan trọng: làm cho khu vực này lấp đầy không gian trống */
}

.detail-content h2 {
    margin-bottom: 15px;
    color: #333;
}

.detail-content img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

.detail-content p {
    line-height: 1.6;
    color: #555;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
}

/* Dán đoạn này vào cuối tệp style.css của bạn */

.detail-actions {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    padding: 20px 30px;
    background-color: #ffffff;

    /* Không cần sticky nữa, vì nó là một phần tử flex cố định */
    flex-shrink: 0;
    /* Ngăn không cho khu vực này bị co lại */
}

.action-btn {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    /* Bo góc tròn */
    overflow: hidden;
    display: block;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

.action-btn img {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- Style cho giao diện Quiz --- */
.quiz-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.quiz-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.quiz-container {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.quiz-question {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 25px;
}

.quiz-options {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    background-color: #f0f2f5;
    border: 2px solid #e0e0e0;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.quiz-option:hover {
    background-color: #e9ecef;
    border-color: #007bff;
}

/* Style cho đáp án sau khi chọn */
.quiz-option.correct {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.quiz-option.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.quiz-feedback {
    margin-top: 20px;
    font-weight: bold;
    height: 24px;
}

.quiz-next-btn {
    margin-top: 15px;
    padding: 12px 30px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    border: none;
    background-color: #007bff;
    color: white;
    display: none;
    /* Ẩn ban đầu */
}

/* --- CSS cho Slider Ảnh --- */

.slider-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    /* Che đi các phần ảnh thừa */
}

.slider {
    position: relative;
    width: 100%;
    /* ↓↓↓ DÒNG LỆNH CẦN SỬA NẰM Ở ĐÂY ↓↓↓
      Thay đổi số 300px thành một số nhỏ hơn, ví dụ 250px hoặc 200px
    */
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out;
}

.slide.active {
    opacity: 1;
    visibility: visible;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Đảm bảo ảnh lấp đầy khung mà không bị méo */
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    height: 40px;
    width: 40px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.slider-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.slider-btn.prev {
    left: 10px;
}

.slider-btn.next {
    right: 10px;
}

/* --- Header Styling --- */

.site-header {
    background-color: #2c3e50;
    /* Màu nền tối cho header (bạn có thể thay đổi) */
    padding: 15px 30px;
    color: white;

    /* Các thuộc tính để căn giữa nội dung */
    display: flex;
    flex-direction: column;
    /* Xếp tiêu đề và nav theo chiều dọc */
    align-items: center;
    /* Căn giữa theo chiều ngang */
}

/* Tạo kiểu cho tiêu đề H1 */
.site-header h1 {
    margin: 0;
    /* Bỏ margin mặc định */
    font-size: 24px;
    /* Cỡ chữ (bạn có thể thay đổi) */
    text-transform: uppercase;
    /* VIẾT HOA */
    letter-spacing: 1.5px;
    /* Giãn cách ký tự */
    margin-bottom: 10px;
    /* Tạo khoảng cách với menu "Trang chủ" */
}

/* Bạn có thể giữ hoặc chỉnh sửa kiểu cho nav-link nếu muốn */
.main-nav .nav-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.main-nav .nav-link:hover {
    color: #f5f5f4;
    /* Màu khi di chuột qua (bạn có thể thay đổi) */
}