/*
Theme Name: Checkin Việt Nam
Theme URI: https://dithoi.net
Author: Đức Mu
Description: Theme du lịch, check-in bản đồ Việt Nam.
Version: 2.4.9
*/

/* =========================================
   1. CSS VARIABLES & THEMES
   ========================================= */
:root {
    --primary-color: #2e7d32;
    --visited-color: #ff9800;
    --bg-color: #f4f6f8;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --modal-overlay: rgba(0,0,0,0.5);
    --map-unchecked: #d1d1d1;
    --map-stroke: #ffffff;
    --btn-bg-gray: #eee;
    --btn-text-gray: #555;
    --menu-hover: #e8f5e9;
    --stat-bg-mobile: #fff;
    --timeline-line: #ddd;
    
    /* List Page Specific */
    --group-header-bg: #f5f5f5;
    --group-header-text: #333;
    --tag-bg: #e5e7eb;
    --tag-text: #374151;
    --tag-hover-bg: #2e7d32;
    --tag-hover-text: #ffffff;

    /* Travel Plan Specific */
    --step-number-bg: #e8f5e9;
    --step-number-text: #2e7d32;
    --slot-bg: #fafafa;
}

body.dark-mode {
    --bg-color: #121212;
    --header-bg: #1e1e1e;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-secondary: #aaaaaa;
    --border-color: #333333;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --modal-overlay: rgba(255,255,255,0.1);
    --map-unchecked: #444444;
    --map-stroke: #2c2c2c;
    --btn-bg-gray: #333;
    --btn-text-gray: #ccc;
    --menu-hover: #333333;
    --stat-bg-mobile: #1e1e1e;
    --timeline-line: #444;
    
    --group-header-bg: #2c2c2c;
    --group-header-text: #e0e0e0;
    --tag-bg: #333333;
    --tag-text: #e0e0e0;

    /* Travel Plan Specific */
    --step-number-bg: #1b5e20;
    --step-number-text: #a5d6a7;
    --slot-bg: #2c2c2c;
}

/* FIX DARK MODE FOR ACCOMMODATION (HOTEL) SECTION */
body.dark-mode #hotel-free-text {
    background-color: #2c2c2c !important; /* Override inline style */
    color: #e0e0e0 !important;
    border-left-color: var(--primary-color) !important;
}

body.dark-mode .hotel-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* FIX DARK MODE FOR PROFILE PAGE - GUIDE REGISTRATION AREA */
body.dark-mode .profile-form-group[style*="background: #e3f2fd"] {
    background-color: #1e2a38 !important; /* Dark blue background */
    border-color: #1565c0 !important;
}
body.dark-mode .profile-form-group[style*="background: #e3f2fd"] h3,
body.dark-mode .profile-form-group[style*="background: #e3f2fd"] label {
    color: #90caf9 !important; /* Light blue text */
}
body.dark-mode .profile-form-group[style*="background: #e3f2fd"] div[style*="background: #fff"] {
    background-color: #2c2c2c !important; /* Dark background for province list */
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

/* FIX DARK MODE FOR TIMELINE SECTION (MY JOURNEY) */
body.dark-mode .timeline-section-full {
    background-color: var(--bg-color) !important;
    border-color: var(--border-color) !important;
}
body.dark-mode .timeline-item-row {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}
body.dark-mode .tl-loc-card {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}
body.dark-mode .tl-spot-card {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}
body.dark-mode .tl-date-selector-group {
    background-color: #333 !important;
    border-color: #555 !important;
}
body.dark-mode .tl-select {
    background-color: #444 !important;
    border-color: #555 !important;
    color: #fff !important;
}
body.dark-mode .tl-btn-action {
    background-color: #333 !important;
    border-color: #555 !important;
    color: #ddd !important;
}
body.dark-mode .tl-btn-action:hover {
    background-color: var(--menu-hover) !important;
    color: var(--primary-color) !important;
}

/* FIX DARK MODE FOR SPOT DETAIL MODAL */
body.dark-mode #spot-detail-body {
    color: var(--text-color) !important;
}
body.dark-mode #spot-detail-body div[style*="color:#333"] {
    color: var(--text-color) !important;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-bottom: 50px;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* FIX FONT AWESOME ICONS */
.fa { font-family: FontAwesome !important; }

/* =========================================
   2. HEADER STYLES
   ========================================= */
header {
    background-color: var(--header-bg);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
}

.header-left { display: flex; align-items: center; gap: 15px; flex-grow: 1; }
.user-info { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color); }
.user-name { font-weight: 700; font-size: 1rem; white-space: nowrap;}
.user-title { font-size: 0.75rem; color: var(--text-secondary); display: none; }
@media (min-width: 768px) { .user-title { display: block; } }

/* MENU DESKTOP */
.desktop-menu { display: none; gap: 5px; margin-left: 20px; }
@media (min-width: 992px) { .desktop-menu { display: flex; } }

/* FIX FONT MENU & STYLE */
.desktop-menu .menu-item {
    position: relative; padding: 8px 12px; cursor: pointer; font-weight: 500;
    color: var(--text-color); border-radius: 4px; display: flex; align-items: center; gap: 5px;
    font-family: 'Roboto', sans-serif !important; 
    font-size: 1rem;
    list-style: none !important; /* XÓA Ô VUÔNG */
}
/* XÓA HOÀN TOÀN PSEUDO ELEMENTS TRÊN LI */
.desktop-menu .menu-item::before, .desktop-menu .menu-item::after { content: none !important; display: none !important; }

.desktop-menu .menu-item:hover { background-color: var(--menu-hover); color: var(--primary-color); }
.desktop-menu .menu-link { 
    display: flex; align-items: center; gap: 6px; 
    font-weight: 500 !important; 
    color: inherit;
    font-family: 'Roboto', sans-serif !important;
}
.desktop-menu .menu-link i { font-size: 1.1em; color: var(--primary-color); font-family: FontAwesome !important; }
.desktop-menu .menu-arrow { margin-left: 3px; font-size: 0.85em; opacity: 0.7; }

/* Menu Highlight (New for Travel Plan link) */
.desktop-menu .menu-item.highlight { background-color: rgba(46, 125, 50, 0.1); color: var(--primary-color); border: 1px solid var(--primary-color); font-weight: bold; }

.desktop-menu .sub-menu {
    display: none; position: absolute; top: 100%; left: 0;
    background-color: var(--card-bg); min-width: 200px;
    box-shadow: var(--shadow); border-radius: 4px; z-index: 10; border: 1px solid var(--border-color);
    padding: 5px 0;
}
.desktop-menu .menu-item:hover > .sub-menu { display: block; animation: fadeIn 0.2s; }
.desktop-menu .sub-menu .menu-item { padding: 8px 15px; display: block; border-radius: 0; width: 100%; }
.desktop-menu .sub-menu .menu-item a { display: block; width: 100%; }
.desktop-menu .sub-menu .menu-item:hover { background-color: var(--menu-hover); }
.desktop-menu .mobile-sub-toggle { display: none; }

/* HEADER RIGHT PC */
.header-right-pc { display: none; align-items: center; gap: 15px; }
@media (min-width: 992px) { .header-right-pc { display: flex; } }

.header-right-pc .dropdown-user { position: relative; padding-bottom: 10px; margin-bottom: -10px; /* Safe area trick part 1 */ }

/* --- FIX HOVER MENU BỊ MẤT NHANH --- */
.header-right-pc .dropdown-content {
    display: none; 
    position: absolute; 
    top: 100%; 
    right: 0; 
    left: auto;
    background-color: var(--card-bg); 
    min-width: 220px;
    box-shadow: var(--shadow); 
    border-radius: 4px; 
    z-index: 100; 
    border: 1px solid var(--border-color);
    margin-top: 5px; 
}

/* Tăng vùng tương tác an toàn để chuột không bị trượt */
.header-right-pc .dropdown-content::before {
    content: "";
    position: absolute;
    top: -20px; /* Mở rộng vùng đệm lên trên */
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
}

.header-right-pc .dropdown-user:hover .dropdown-content { display: block; animation: fadeIn 0.2s; }
.header-right-pc .dropdown-item { padding: 10px 15px; display: flex; align-items: center; gap: 8px; color: var(--text-color); text-decoration: none; font-size: 0.9rem; transition: background 0.2s; }
.header-right-pc .dropdown-item:hover { background-color: var(--menu-hover); color: var(--primary-color); }

/* HEADER RIGHT MOBILE */
.header-right-mobile { display: flex; align-items: center; gap: 10px; margin-right: 20px; } 
@media (min-width: 992px) { .header-right-mobile { display: none; } }

.header-right-mobile .menu-item { position: static; margin-right: 15px; }
.header-right-mobile .mobile-sub-toggle { border: none; padding: 0; width: auto; height: auto; background: transparent; }
.header-right-mobile .mobile-sub-toggle img { border: 2px solid var(--border-color); }

.header-right-mobile .menu-item .sub-menu {
    display: none; position: fixed; top: 60px; left: 0; right: 0; width: 100%;
    background: var(--card-bg); border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 1001; padding: 0; margin: 0;
}
.header-right-mobile .menu-item .sub-menu .dropdown-item {
    padding: 15px 20px; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 10px; font-size: 1rem; color: var(--text-color); width: 100%;
}

/* MOBILE MENU OVERLAY */
.mobile-menu-overlay {
    position: fixed; top: 60px; right: -100%; width: 280px; height: calc(100vh - 60px);
    background: var(--card-bg); box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease; z-index: 99; padding-top: 0; padding-bottom: 20px;
    display: flex; flex-direction: column; gap: 0; border-left: 1px solid var(--border-color);
    overflow-y: auto;
}
.mobile-menu-overlay.open { right: 0; }
.mobile-menu-overlay .menu-item {
    font-size: 1rem; font-weight: 500; color: var(--text-color); padding: 15px 20px;
    border-bottom: 1px solid var(--border-color); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; width: 100%;
}
.mobile-menu-overlay .menu-item .menu-arrow { display: none; }
.mobile-menu-overlay .menu-item a { display: flex; align-items: center; gap: 10px; color: inherit; flex: 1; }
.mobile-menu-overlay .menu-item i.fa { color: var(--primary-color); width: 20px; text-align: center; }
.mobile-sub-toggle { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--border-color); margin-right: -20px; cursor: pointer; background: var(--bg-color); }
.mobile-menu-overlay .sub-menu { display: none; width: 100%; margin-top: 10px; background: var(--bg-color); padding-left: 20px; border-radius: 4px; }
.mobile-menu-overlay .sub-menu.open { display: block; }
.mobile-menu-overlay .sub-menu .menu-item { border-bottom: none; padding: 8px 0; font-size: 0.9rem; color: var(--text-secondary); }

/* AUTH LINKS */
.auth-switch-link { color: var(--primary-color); cursor: pointer; text-decoration: underline; font-weight: 500; }
.auth-divider { display: flex; align-items: center; text-align: center; margin: 15px 0; color: var(--text-secondary); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border-color); }
.auth-divider:not(:empty)::before { margin-right: .5em; }
.auth-divider:not(:empty)::after { margin-left: .5em; }

/* =========================================
   3. PROFILE PAGE STYLES (EDIT MODE)
   ========================================= */
.profile-container { max-width: 800px; margin: 40px auto; background: var(--card-bg); padding: 30px; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border-color); }
.profile-title h1 { font-size: 1.5rem; margin-bottom: 5px; }
.profile-title p { color: var(--text-secondary); }
.profile-form-group { margin-bottom: 20px; }
.profile-form-group label { display: block; font-weight: 500; margin-bottom: 8px; color: var(--text-color); }
.profile-form-group input[type="text"], .profile-form-group input[type="email"], .profile-form-group input[type="password"], .profile-form-group input[type="url"], .profile-form-group textarea, .profile-form-group select { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-color); color: var(--text-color); font-size: 1rem; }
.profile-form-group input[readonly] { background: #eee; cursor: not-allowed; color: #888; }
@media (max-width: 768px) {
    .profile-container { margin: 20px 15px; padding: 20px; }
    .profile-header { flex-direction: column; text-align: center; gap: 15px; }
}

/* STATS */
.stats-container { display: none; gap: 20px; align-items: center; } 
@media (min-width: 992px) { .stats-container { display: flex; } }
.stat-item { text-align: center; }
.stat-number { font-size: 1.1rem; font-weight: 700; color: var(--visited-color); display: block; }
.stat-label { font-size: 0.75rem; color: var(--text-secondary); }

/* MOBILE STATS & TOOLBAR */
.mobile-stats-bar { display: flex; justify-content: space-around; padding: 10px 15px; background-color: var(--stat-bg-mobile); border-bottom: 1px solid var(--border-color); }
@media (min-width: 992px) { .mobile-stats-bar { display: none; } }
.mobile-toolbar { display: flex; gap: 10px; padding: 10px 15px; background-color: var(--bg-color); flex-wrap: wrap; }
@media (min-width: 992px) { .mobile-toolbar { display: none; } }

/* MOBILE SEARCH */
.mobile-search-section { padding: 10px 20px 0 20px; display: none; }
@media (max-width: 991px) { .mobile-search-section { display: block; } }
.mobile-search-input { width: 100%; padding: 10px 15px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--card-bg); color: var(--text-color); outline: none; font-size: 0.95rem; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* =========================================
   4. BUTTONS & UI ELEMENTS
   ========================================= */
.btn { padding: 8px 12px; border: none; border-radius: 6px; cursor: pointer; font-weight: 500; display: flex; align-items: center; gap: 6px; font-size: 0.85rem; white-space: nowrap; }
.btn-green { background-color: var(--primary-color); color: #fff; }
.btn-blue { background-color: #1976d2; color: #fff; }
.btn-purple { background-color: #7b1fa2; color: #fff; }
.btn-orange { background-color: #ff9800; color: #fff; } 
.btn-red { background-color: #d32f2f; color: #fff; }
.btn-outline { border: 1px solid var(--border-color); background: transparent; color: var(--text-color); }
.btn-icon-only { padding: 8px; font-size: 1.1rem; justify-content: center; width: 40px; }
.btn-sm { padding: 4px 8px; font-size: 0.8rem; }

/* LOADING BUTTON STYLE */
.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}
.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    z-index: 10;
}
.btn.btn-outline.loading::after {
    border-top-color: var(--primary-color);
}
/* Hide icon/content while loading */
.btn.loading i, .btn.loading span { 
    opacity: 0; 
} 

@keyframes btn-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================================
   FIX: PC SEARCH OVERLAP - THE "NUCLEAR GRID" METHOD 
   (Strict Separation + Box-Sizing Fix)
   ============================================================= */

.pc-search-toolbar { 
    /* Dùng Grid để chia layout cứng */
    display: grid !important; 
    
    /* Cột 1 (Search): Cố định 200px. Cột 2 (Filters): Phần còn lại */
    grid-template-columns: 200px minmax(0, 1fr) !important;
    
    /* Khoảng cách an toàn giữa 2 cột */
    gap: 20px !important;
    
    align-items: center !important; 
    width: 100% !important; 
    background: var(--card-bg); 
    padding: 10px; 
    border-radius: 8px; 
    border: 1px solid var(--border-color); 
    box-shadow: var(--shadow); 
    position: relative;
    z-index: 10; 
    box-sizing: border-box !important;
}

/* Chỉ áp dụng Grid trên PC (>= 992px) */
@media (min-width: 992px) { 
    .pc-search-toolbar { display: grid !important; } 
}

/* OBJECT 1: SEARCH GROUP (FIXED COLUMN 1) */
.pc-search-input-group { 
    grid-column: 1 / 2 !important; /* Bắt buộc nằm cột 1 */
    width: 100% !important; 
    min-width: unset !important;
    max-width: unset !important;
    position: relative !important; 
    margin-right: 0 !important;
    z-index: 20; 
}

/* Icon kính lúp */
.pc-search-input-group i { 
    position: absolute; 
    left: 10px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--text-secondary); 
    font-size: 0.9rem;
    z-index: 21;
}

/* Input tìm kiếm - FIX QUAN TRỌNG: box-sizing */
.pc-search-input { 
    /* Bắt buộc tính padding vào trong width 100% */
    box-sizing: border-box !important; 
    width: 100% !important; 
    padding: 8px 10px 8px 35px !important; 
    border: 1px solid var(--border-color); 
    border-radius: 20px; 
    background: var(--bg-color); 
    color: var(--text-color); 
    outline: none; 
    font-size: 0.9rem; 
    height: 40px; 
}

/* OBJECT 2: FILTER GROUP (SCROLLABLE COLUMN 2) */
.home-filter-group { 
    grid-column: 2 / 3 !important; /* Bắt buộc nằm cột 2 */
    
    /* Cấu hình Flex nội bộ cho các nút filter */
    display: flex !important; 
    align-items: center !important; 
    gap: 10px !important; 
    
    /* Xử lý cuộn */
    overflow-x: auto !important; 
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    
    width: 100% !important;
    
    /* QUAN TRỌNG: Ngăn chặn Grid Item bị vỡ layout */
    min-width: 0 !important; 
    
    padding-bottom: 5px; 
    margin-left: 0 !important;
    scrollbar-width: thin; 
    -webkit-overflow-scrolling: touch;
}

/* Style cho thanh cuộn của Filter */
.home-filter-group::-webkit-scrollbar { height: 4px; }
.home-filter-group::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.home-filter-group::-webkit-scrollbar-track { background: transparent; }

/* Các nút Filter bên trong */
.filter-chip { 
    flex: 0 0 auto !important; /* Không co giãn nút filter */
    white-space: nowrap !important;
    padding: 6px 12px; 
    border: 1px solid var(--border-color); 
    background: var(--card-bg); 
    border-radius: 20px; 
    cursor: pointer; 
    font-size: 0.8rem; 
    color: var(--text-color); 
    transition: all 0.2s; 
}

/* FIX ACTIVE STATE COLOR */
.filter-chip.active, button.filter-chip.active { 
    background-color: var(--primary-color) !important; 
    color: #fff !important; 
    border-color: var(--primary-color) !important; 
    font-weight: bold; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); 
}

/* =========================================
   5. MAIN LAYOUTS
   ========================================= */
/* DEFAULT LAYOUT */
main { display: flex; padding: 20px; gap: 20px; max-width: 1600px; margin: 0 auto; flex-direction: column; }

/* === LIST PAGE SPECIFIC (80% WIDTH) === */
main.list-archive-main {
    width: 80%;
    max-width: 1920px; /* Cho phép rộng hơn trên màn lớn */
    margin: 0 auto;
}
@media (max-width: 1200px) { main.list-archive-main { width: 90%; } }
@media (max-width: 768px) { main.list-archive-main { width: 100%; padding: 15px; } }

/* === FIX BROKEN CSS INSIDE LIST PAGE === */
main.list-archive-main .section-header,
main.list-archive-main .province-list-container,
main.list-archive-main .list-toolbar,
main.list-archive-main .spot-grid-layout,
main.list-archive-main .pagination-container {
    width: 100%;
    max-width: 100%; 
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
}

/* SECTION HEADER ALIGNMENT - FIXED FOR PC AND MOBILE */
main.list-archive-main .section-header {
    display: flex;
    justify-content: space-between; /* Push button to right */
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
/* Ensure title doesn't force wrap if not needed */
main.list-archive-main .section-header .section-title {
    margin-bottom: 0;
}

/* BUTTON TEXT TOGGLE */
.btn-text-mobile { display: none; }
.btn-text-pc { display: inline; }

@media (max-width: 768px) {
    .btn-text-pc { display: none; }
    .btn-text-mobile { display: inline; }
    /* Make button smaller on mobile */
    #btn-toggle-merge-list { font-size: 0.8rem; padding: 5px 10px; }
}

/* GRID LAYOUTS FOR PROVINCE LIST (4 COLS PC) */
main.list-archive-main .province-list-container {
    display: grid; gap: 20px;
}
@media (min-width: 992px) { 
    main.list-archive-main .province-list-container { 
        grid-template-columns: repeat(4, 1fr); /* 4 CỘT TRÊN PC */
    } 
}
@media (max-width: 991px) { 
    main.list-archive-main .province-list-container { 
        grid-template-columns: repeat(2, 1fr); 
    } 
}
@media (max-width: 576px) { 
    main.list-archive-main .province-list-container { 
        grid-template-columns: 1fr; 
    } 
}

/* SPOT GRID LAYOUT */
main.list-archive-main .spot-grid-layout {
    display: grid; 
    gap: 20px;
}
@media (min-width: 992px) { 
    main.list-archive-main .spot-grid-layout { 
        grid-template-columns: repeat(3, 1fr); 
    } 
}
@media (max-width: 991px) { 
    main.list-archive-main .spot-grid-layout { 
        grid-template-columns: repeat(2, 1fr); 
    } 
}
@media (max-width: 576px) { 
    main.list-archive-main .spot-grid-layout { 
        grid-template-columns: 1fr; 
    } 
}

/* REST OF CSS */
.top-content-row { display: flex; gap: 20px; flex-direction: column; min-height: calc(100vh - 80px); }
@media (min-width: 992px) { .top-content-row { flex-direction: row; height: 600px; min-height: 0; } }

/* =========================================
   6. MAP SECTION & PROVINCE LIST
   ========================================= */
.map-section { flex: 1; background: var(--card-bg); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; position: relative; min-height: 500px; height: 100%; overflow: hidden; border: 1px solid var(--border-color); align-items: center; justify-content: center; }
@media (max-width: 991px) { .map-section { min-height: 500px; } }
#vector-map-wrapper { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
#vector-map-wrapper svg { width: 100%; height: 100%; max-height: none; }
.province-path { stroke: var(--map-stroke); stroke-width: 1px; fill: var(--map-unchecked); cursor: pointer; transition: fill 0.3s; vector-effect: non-scaling-stroke; }
.province-path.active { fill: var(--visited-color); }
.province-path:hover { opacity: 0.9; stroke: #333; }
.map-tooltip { position: absolute; background: rgba(0, 0, 0, 0.8); color: #fff; padding: 5px 10px; border-radius: 4px; font-size: 12px; pointer-events: none; z-index: 1000; display: none; white-space: nowrap; transform: translate(-50%, -120%); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.map-legend { position: absolute; bottom: 20px; left: 20px; background: rgba(255,255,255,0.9); padding: 10px; border-radius: 8px; font-size: 0.8rem; color: #333; pointer-events: none; z-index: 500; }
body.dark-mode .map-legend { background: rgba(30,30,30,0.9); color: #fff; }
.map-controls { position: absolute; top: 20px; right: 20px; left: auto; z-index: 10; }

/* LIST SECTION */
.list-section { flex: 1; overflow-y: auto; padding-right: 5px; display: flex; flex-direction: column; }
@media (max-width: 991px) { .list-section { max-height: 80vh; } }
.list-section::-webkit-scrollbar { width: 6px; }
.list-section::-webkit-scrollbar-track { background: transparent; }
.list-section::-webkit-scrollbar-thumb { background: #bbb; border-radius: 3px; }
.province-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; } 
@media (max-width: 576px) { .province-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.province-card { background: var(--card-bg); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; border: 1px solid var(--border-color); transition: transform 0.2s; position: relative; }
.province-card.checked { border-color: var(--visited-color); }
.province-card.highlight-card { box-shadow: 0 0 15px var(--visited-color); border-color: var(--visited-color); transform: scale(1.02); z-index: 5; }
.card-img-wrapper { height: 120px; position: relative; background-color: #ddd; }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.btn-create-plan { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.7); color: #fff; border: 1px solid rgba(255,255,255,0.3); padding: 6px 10px; border-radius: 20px; font-size: 0.75rem; cursor: pointer; display: flex; align-items: center; gap: 5px; backdrop-filter: blur(4px); z-index: 5; transition: 0.2s; }
.btn-create-plan:hover { background: var(--primary-color); border-color: var(--primary-color); }
.check-badge { position: absolute; top: 8px; left: 8px; background: var(--visited-color); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; opacity: 0; transform: scale(0); transition: 0.3s; z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.province-card.checked .check-badge { opacity: 1; transform: scale(1); }
.card-body { padding: 12px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 8px;}
.province-name { font-size: 1rem; font-weight: 700; color: var(--text-color); margin-bottom: 2px; }
.province-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 5px; }
.card-actions { display: flex; gap: 5px; margin-top: auto; }
.btn-checkin-mini { flex: 1; padding: 8px; border-radius: 6px; border: none; background: var(--btn-bg-gray); color: var(--btn-text-gray); font-weight: 500; cursor: pointer; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; gap: 5px; }
.province-card.checked .btn-checkin-mini { background: #e8f5e9; color: var(--primary-color); }
body.dark-mode .province-card.checked .btn-checkin-mini { background: #1b5e20; color: #fff; }
.btn-info-mini { padding: 8px 12px; border-radius: 6px; border: none; background: #e3f2fd; color: #1565c0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
body.dark-mode .btn-info-mini { background: #0d47a1; color: #fff; }

/* =========================================
   7. MODALS & POPUPS
   ========================================= */
/* MODALS (Updated Z-Index for Interaction Fix) */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(3px); z-index: 100000; display: none; align-items: center; justify-content: center; padding: 0; }
.modal-overlay.open { display: flex; animation: fadeIn 0.2s; }
.modal-content { background: var(--card-bg); width: 90%; max-width: 1200px; max-height: 90vh; border-radius: 12px; display: flex; flex-direction: column; box-shadow: 0 10px 25px rgba(0,0,0,0.2); position: relative; margin: auto; z-index: 100001; pointer-events: auto !important; }
.form-modal-content { max-width: 500px !important; height: auto !important; max-height: 90vh !important; }
.modal-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.modal-title { font-size: 1.1rem; font-weight: bold; color: var(--text-color); }
.btn-close { background: none; border: none; font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; padding: 0; line-height: 1; }
.modal-body { padding: 20px; overflow-y: auto; display: block; color: var(--text-color); flex-grow: 1; position: relative; z-index: 10; }
.modal-footer { padding: 15px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; background: var(--card-bg); flex-shrink: 0; }
.contact-form { display: flex; flex-direction: column; gap: 15px; }
.contact-group { display: flex; flex-direction: column; gap: 5px; }
.contact-label { font-weight: 500; font-size: 0.9rem; color: var(--text-color); }
/* Force interaction on inputs */
.contact-input, .contact-textarea, .contact-select { padding: 10px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-color); color: var(--text-color); outline: none; width: 100%; pointer-events: auto !important; }
.contact-textarea { min-height: 120px; resize: vertical; }

/* FIX FAB POSITION - Đẩy lên cao hơn (250px) để không bị che bởi Bottom Bar */
/* UPDATED: Increased bottom to 250px to ensure it's above share section in view mode */
.fab-container { 
    position: fixed; 
    bottom: 250px; 
    right: 30px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    z-index: 1000; 
}
.fab-btn { width: 45px; height: 45px; border-radius: 50%; border: none; background: var(--primary-color); color: #fff; font-size: 1.2rem; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; transition: transform 0.2s, background 0.2s; }
.fab-btn:hover { transform: scale(1.1); filter: brightness(1.1); }
.fab-btn.secondary { background: var(--card-bg); color: var(--text-color); border: 1px solid var(--border-color); }
.fab-btn.hidden { opacity: 0; visibility: hidden; pointer-events: none; transition: 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- INFO MODAL & SPOT GRID --- */
.info-section-title { font-size: 1.1rem; font-weight: bold; margin: 20px 0 10px; border-left: 4px solid var(--primary-color); padding-left: 10px; color: var(--text-color); }
.info-section-title:first-child { margin-top: 0; }
.spot-filter-bar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; background: var(--bg-color); padding: 15px; border-radius: 8px; border: 1px solid var(--border-color); }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-label { font-weight: 500; font-size: 0.85rem; min-width: 70px; color: var(--text-secondary); white-space: nowrap; }
.filter-input-search { flex: 1; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--card-bg); color: var(--text-color); outline: none; min-width: 200px; }
.sort-select { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-color); outline: none; font-size: 0.85rem; }
@media (max-width: 768px) {
    .filter-row.scroll-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
    .filter-row.scroll-row::-webkit-scrollbar { display: none; }
    .spot-filter-bar { display: flex; flex-direction: column; }
    .filter-row.search-sort-row { order: 99; border-top: 1px solid var(--border-color); padding-top: 12px; } 
    .filter-row.region-row { order: 1; }
    .filter-row.distance-row { order: 2; }
}
.spot-grid { display: grid; gap: 15px; margin-top: 10px; }
@media (min-width: 992px) { .spot-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991px) { .spot-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .spot-grid { grid-template-columns: 1fr; } } 

.spot-card { border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; cursor: default; transition: 0.2s; background: var(--card-bg); display: flex; flex-direction: column; position: relative; height: auto; }
.spot-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.spot-img-wrapper { position: relative; height: 140px; }
.spot-img { width: 100%; height: 100%; object-fit: cover; background: #eee; }
.spot-body { padding: 10px; font-size: 0.85rem; display: flex; flex-direction: column; gap: 5px; flex-grow: 1; }
.spot-region-label { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.7); color: #fff; backdrop-filter: blur(2px); padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 500; z-index: 2; }
.spot-views { position: absolute; bottom: 5px; left: 5px; background: rgba(0,0,0,0.6); color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; z-index: 2; display: flex; align-items: center; gap: 4px; }
.spot-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 5px; }
.spot-name { font-weight: bold; color: var(--primary-color); font-size: 0.95rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spot-rating { display: flex; align-items: center; gap: 2px; font-size: 0.75rem; background: #fff9c4; padding: 2px 5px; border-radius: 3px; color: #fbc02d; font-weight: bold; white-space: nowrap; }
body.dark-mode .spot-rating { background: #4a4a3a; }
.spot-desc-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 5px; font-size: 0.75rem; color: var(--text-secondary); }
.spot-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.btn-expand { color: var(--primary-color); cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 0.75rem; text-decoration: underline; margin-left: 5px; }
.spot-meta { font-size: 0.75rem; color: #888; display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 5px; border-top: 1px solid var(--border-color); }
.spot-details-full { display: none; padding-top: 10px; border-top: 1px dashed var(--border-color); margin-top: 5px; font-size: 0.85rem; color: var(--text-color); animation: fadeIn 0.3s; }
.spot-details-full p { margin-bottom: 8px; }
.spot-details-full strong { color: var(--text-color); }

/* BUTTON CHECKIN SPOT (Popup Style) */
.btn-checkin-spot {
    position: absolute; bottom: 10px; right: 10px;
    background: #fff; color: #333; border: 1px solid #ddd;
    padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: bold;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex; align-items: center; gap: 4px; z-index: 3;
    transition: all 0.2s;
}
.btn-checkin-spot:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.btn-checkin-spot.checked { background: var(--visited-color); color: #fff; border-color: var(--visited-color); }
.btn-checkin-spot i { font-size: 1rem; }

/* NEW: BUTTON CREATE PLAN ON SPOT CARD (TOP RIGHT) */
.btn-create-plan-spot {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0,0,0,0.7); color: #fff; border: 1px solid rgba(255,255,255,0.3);
    padding: 5px; border-radius: 50%; font-size: 0.9rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); z-index: 5; transition: 0.2s; width: 30px; height: 30px;
}
.btn-create-plan-spot:hover { background: var(--primary-color); border-color: var(--primary-color); }

/* MODAL INFO HEADER */
.modal-info-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 10px; }
@media (max-width: 576px) {
    .modal-info-header { flex-direction: column; align-items: flex-start; }
    .modal-info-header > div { width: 100%; }
}

.region-card {
    background: var(--card-bg); border-radius: 10px; overflow: hidden;
    box-shadow: var(--shadow); display: flex; flex-direction: column;
    border: 1px solid var(--border-color);
}
.region-card-img-wrapper {
    height: 120px; width: 100%; position: relative;
    background: #333;
}
.region-card-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.region-card-title-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff; padding: 20px 15px 10px; font-weight: bold; font-size: 1.1rem; text-transform: uppercase;
}
.region-card-body {
    padding: 15px; display: flex; flex-wrap: wrap; gap: 8px;
}
.province-tag {
    background-color: var(--tag-bg); color: var(--tag-text);
    padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; cursor: pointer;
    transition: 0.2s; user-select: none;
}
.province-tag:hover, .province-tag.active {
    background-color: var(--tag-hover-bg); color: var(--tag-hover-text);
}

.list-toolbar {
    max-width: 100%; margin: 0 auto; padding: 0 10px 20px;
    display: flex; flex-direction: column; gap: 15px;
    background: var(--bg-color); width: 100%;
}
.toolbar-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.scroll-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
.scroll-row::-webkit-scrollbar { display: none; }

.input-search {
    flex: 1; padding: 10px 15px; border: 1px solid var(--border-color); border-radius: 6px;
    background: var(--card-bg); color: var(--text-color); outline: none; min-width: 200px;
}
.select-custom {
    padding: 10px; border-radius: 6px; border: 1px solid var(--border-color);
    background: var(--card-bg); color: var(--text-color); outline: none; cursor: pointer;
}

.spot-grid-layout {
    display: grid; gap: 20px; max-width: 100%; margin: 0 auto; padding: 0 10px; width: 100%;
}

/* CARD LIST PAGE STYLE */
.spot-img-container { position: relative; height: 200px; width: 100%; cursor: pointer; }
.spot-view-badge {
    position: absolute; bottom: 8px; left: 8px;
    background: rgba(0,0,0,0.6); color: #fff; backdrop-filter: blur(2px);
    padding: 3px 8px; border-radius: 4px; font-size: 0.75rem;
    display: flex; align-items: center; gap: 4px; z-index: 2;
}
/* Province Label Top-Right */
.spot-province-label {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.7); color: #fff; backdrop-filter: blur(2px);
    padding: 4px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; z-index: 2;
}
/* Check Button Bottom-Right */
.spot-check-btn {
    position: absolute; bottom: 10px; right: 10px;
    background: #fff; color: #333; border: 1px solid #ddd;
    padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: bold;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex; align-items: center; gap: 4px; z-index: 3;
    transition: all 0.2s;
}
.spot-check-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.spot-check-btn.checked { background: var(--visited-color); color: #fff; border-color: var(--visited-color); }
.spot-check-btn i { font-size: 1rem; }

.pagination-container {
    display: flex; justify-content: center; gap: 8px; margin: 30px auto; max-width: 100%;
}
.page-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; border: 1px solid var(--border-color); background: var(--card-bg);
    color: var(--text-color); cursor: pointer; font-weight: 500;
}
.page-btn:hover { background: var(--btn-bg-gray); }
.page-btn.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.page-btn.disabled { opacity: 0.5; cursor: not-allowed; }

/* =========================================
   8. TRAVEL PLANNER STYLES (NEW)
   ========================================= */
.plan-container { max-width: 1000px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 30px; }
.section-card { background: var(--card-bg); border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--border-color); padding: 25px; position: relative; }
.section-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.step-number { width: 32px; height: 32px; background: var(--step-number-bg); color: var(--step-number-text); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1rem; flex-shrink: 0; }
.section-title { font-size: 1.2rem; font-weight: bold; color: var(--text-color); }

.form-group { margin-bottom: 15px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-secondary); font-size: 0.9rem; }
.form-control { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-color); color: var(--text-color); outline: none; font-size: 1rem; }
.form-control:focus { border-color: var(--primary-color); }

/* Suggestions */
.province-suggestions { display: none; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; max-height: 200px; overflow-y: auto; }
.province-chip { padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 20px; font-size: 0.9rem; cursor: pointer; text-align: center; background: var(--card-bg); }
.province-chip:hover { background: var(--menu-hover); color: var(--primary-color); }

/* Date & Weather */
.date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.weather-info-box { background: #e3f2fd; border-left: 4px solid #2196f3; padding: 15px; border-radius: 4px; margin-top: 15px; font-size: 0.95rem; color: #0d47a1; display: none; }
.info-display-box { background: var(--bg-color); padding: 15px; border-radius: 8px; margin-top: 10px; border: 1px dashed var(--border-color); font-size: 0.9rem; line-height: 1.5; }

/* Transport */
.transport-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; }
.transport-card { border: 2px solid var(--border-color); border-radius: 10px; padding: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; text-align: center; transition: 0.2s; background: var(--card-bg); }
.transport-card.selected { border-color: var(--primary-color); background: rgba(46, 125, 50, 0.1); }
.transport-card i { font-size: 1.5rem; color: var(--text-secondary); }
.transport-card.selected i { color: var(--primary-color); }

/* Hotels */
.filter-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; margin-bottom: 15px; }
.hotel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; }
.hotel-card { border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; position: relative; cursor: pointer; display: flex; flex-direction: column; background: var(--card-bg); }
.hotel-card.selected { border: 2px solid var(--primary-color); }
.hotel-img-wrapper { position: relative; width: 100%; height: 130px; }
.hotel-img { width: 100%; height: 100%; object-fit: cover; }
.hotel-type-label { position: absolute; bottom: 0; left: 0; background: rgba(0,0,0,0.7); color: #fff; padding: 3px 8px; font-size: 0.7rem; border-top-right-radius: 6px; text-transform: uppercase; }
.hotel-body { padding: 12px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.hotel-name { font-weight: bold; font-size: 1rem; margin-bottom: 4px; color: var(--text-color); }
.hotel-desc { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hotel-meta-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.hotel-price { color: #d32f2f; font-weight: bold; font-size: 0.9rem; }
.hotel-address { font-size: 0.75rem; color: var(--text-secondary); max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.hotel-check { position: absolute; top: 5px; right: 5px; background: var(--primary-color); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: none; align-items: center; justify-content: center; font-size: 0.8rem; z-index: 2; }
.hotel-card.selected .hotel-check { display: flex; }

/* Timeline */
.timeline-container { position: relative; padding-left: 20px; margin-top: 20px; }
.timeline-line-vertical { position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: var(--timeline-line); }
.day-block { margin-bottom: 20px; position: relative; }
.day-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; background: var(--primary-color); color: #fff; padding: 8px 15px; border-radius: 20px; display: inline-flex; font-weight: bold; font-size: 0.95rem; position: relative; z-index: 1; cursor: pointer; }
.day-toggle-icon { transition: transform 0.3s; }
.day-block.collapsed .day-toggle-icon { transform: rotate(-90deg); }
.day-content { transition: max-height 0.3s ease-out; overflow: hidden; }
.day-block.collapsed .day-content { display: none; }
.time-slot { margin-left: 20px; padding: 15px; background: var(--slot-bg); border-radius: 8px; border-left: 3px solid var(--border-color); margin-bottom: 10px; position: relative; }
.slot-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.slot-time-input { border: 1px solid transparent; background: transparent; color: var(--primary-color); font-weight: bold; font-size: 1rem; width: 120px; outline: none; font-family: inherit; }
.slot-time-input:focus { border-bottom: 1px solid var(--primary-color); }
.slot-type { font-size: 0.8rem; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 0.5px; }
.selected-item { background: var(--card-bg); padding: 10px; border: 1px solid var(--border-color); border-radius: 6px; display: flex; gap: 10px; position: relative; margin-bottom: 8px; }
.selected-item img { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; }
.selected-item-info { flex: 1; font-size: 0.9rem; }
.selected-item-name { font-weight: 600; margin-bottom: 3px; color: var(--text-color); }
.selected-item-desc { font-size: 0.8rem; color: #555; margin-bottom: 4px; font-style: italic; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.selected-item-meta { font-size: 0.75rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 8px; }
.item-remove { position: absolute; top: 10px; right: 10px; color: #d32f2f; cursor: pointer; }
.btn-add-group { display: flex; gap: 10px; margin-top: 10px; }
.btn-add-item { border: 1px dashed var(--border-color); background: transparent; flex: 1; padding: 8px; border-radius: 4px; color: var(--text-secondary); cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; gap: 5px; }
.btn-add-item:hover { border-color: var(--primary-color); color: var(--primary-color); background: rgba(46,125,50,0.05); }

/* Guides */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.guide-card { border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; display: flex; gap: 15px; cursor: pointer; background: var(--card-bg); align-items: flex-start; }
.guide-card.selected { border: 2px solid var(--primary-color); background: rgba(46,125,50,0.05); }
.guide-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color); }
.guide-info { flex: 1; font-size: 0.9rem; }
.guide-name { font-weight: bold; font-size: 1rem; margin-bottom: 2px; }
.guide-meta { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; }
.skill-tag { background: #e3f2fd; color: #1976d2; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-right: 4px; }

/* Cost Table */
.cost-table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cost-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.95rem; min-width: 500px; }
.cost-table th, .cost-table td { padding: 10px; border-bottom: 1px solid var(--border-color); text-align: left; }
.cost-table th { background: var(--menu-hover); color: var(--primary-color); font-weight: bold; white-space: nowrap; }
.cost-table tfoot td { font-weight: bold; color: #d32f2f; font-size: 1.1rem; border-top: 2px solid var(--border-color); border-bottom: none; }
.cost-value { text-align: right; }
.people-count-wrapper { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }
.people-input { width: 60px; padding: 5px; border: 1px solid var(--border-color); border-radius: 4px; text-align: center; font-weight: bold; color: var(--primary-color); outline: none; }

/* Privacy */
.privacy-options-container { display: flex; gap: 20px; }
.option-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; flex: 1; }
.option-toggle.active { border-color: var(--primary-color); background: rgba(46,125,50,0.05); }
.toggle-circle { width: 20px; height: 20px; border: 2px solid var(--text-secondary); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toggle-circle::after { content: ''; width: 10px; height: 10px; background: var(--primary-color); border-radius: 50%; display: none; }
.option-toggle.active .toggle-circle { border-color: var(--primary-color); }
.option-toggle.active .toggle-circle::after { display: block; }

/* Selection Modal */
/* UPDATED: 2 Columns for PC */
.select-grid { 
    display: grid; 
    gap: 10px; 
    max-height: 400px; 
    overflow-y: auto; 
    /* PC Default */
    grid-template-columns: 1fr 1fr;
}
.select-item-card { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; align-items: center; position: relative; }
.select-item-card:hover { background: var(--menu-hover); }
.select-item-card.selected { border-color: var(--primary-color); background: rgba(46,125,50,0.05); }
.select-item-img { width: 60px; height: 60px; border-radius: 4px; object-fit: cover; }
.check-indicator { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-color); display: flex; align-items: center; justify-content: center; }
.select-item-card.selected .check-indicator { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

/* ADDED: SELECTED LABEL STYLE */
.selected-label {
    position: absolute;
    top: 5px; right: 40px; /* Left of check indicator */
    background: #e8f5e9; color: #2e7d32;
    padding: 2px 6px; border-radius: 4px;
    font-size: 0.7rem; font-weight: bold;
    display: none; /* Default hidden */
}

/* Success Modal */
.share-row { display: flex; gap: 15px; justify-content: center; margin-top: 20px; }
.share-btn { width: 40px; height: 40px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; }
.download-options { display: flex; gap: 10px; justify-content: center; margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 20px; }

/* Toggle API/Manual Switch */
.switch-mode-wrapper { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.switch-mode-btn { font-size: 0.8rem; cursor: pointer; color: var(--primary-color); text-decoration: underline; background: none; border: none; }

/* Password Toggle Icon */
.password-group { position: relative; }
.toggle-password { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-secondary); z-index: 100002 !important; padding: 10px; display: block !important; }

/* CUSTOM ACTIVITY UPLOAD IMAGE */
.custom-act-img-preview {
    width: 100%; height: 150px; 
    border: 2px dashed var(--border-color); 
    border-radius: 8px; 
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; overflow: hidden; margin-bottom: 10px;
    background-size: cover; background-position: center;
}
.custom-act-img-preview span { color: var(--text-secondary); font-size: 0.9rem; pointer-events: none; }

/* BOTTOM BAR CENTERED */
.bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0; 
    background: var(--card-bg); padding: 10px 20px; 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1); 
    display: flex; justify-content: center; /* CENTERED */
    gap: 15px; z-index: 999;
}

/* --- MOBILE FLOATING COMMENT BUTTON --- */
.floating-comment-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px; height: 50px;
    background: #1877f2; /* FB Blue */
    color: #fff;
    border-radius: 50%;
    display: none; /* Default Hidden on PC */
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 99999; /* Fix Z-index */
    cursor: pointer;
    transition: transform 0.2s;
}
.floating-comment-btn:active { transform: scale(0.9); }

/* --- MOBILE COMMENT BOTTOM SHEET --- */
.comment-bottom-sheet {
    position: fixed;
    bottom: -100%; /* Hidden by default */
    left: 0; right: 0;
    background: var(--card-bg);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    z-index: 100010; /* Higher than sheet overlay */
    transition: bottom 0.3s ease-out;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}
.comment-bottom-sheet.open {
    bottom: 0;
}
.sheet-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.1rem;
}
.close-sheet {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Mobile Adjustments */
@media (max-width: 991px) { /* Tăng lên 991px để bao phủ cả tablet/S22+ xoay ngang */
    .transport-grid { grid-template-columns: repeat(3, 1fr); }
    .transport-card { padding: 10px; font-size: 0.85rem; }
    .timeline-container { padding-left: 0; }
    .timeline-line-vertical { display: none; }
    .time-slot { margin-left: 0; border-left: none; padding: 10px; background: var(--menu-hover); }
    .privacy-options-container { flex-direction: column; gap: 10px; }
    .people-count-wrapper { width: 100%; margin-top: 10px; justify-content: flex-end; }
    
    /* Mobile 1 column for selection grid */
    .select-grid { grid-template-columns: 1fr; }

    /* Hide PC Comment Section on Mobile to use Floating Button instead */
    /* FIX 1: HIỂN THỊ LẠI KHUNG COMMENT MẶC ĐỊNH TRÊN MOBILE */
    #step-comments { display: block !important; }
    .floating-comment-btn { display: none !important; }
    .comment-bottom-sheet { display: none !important; }
    
    /* Show Floating Button on Mobile IF View Mode */
    /* Controlled by body class added via JS, thêm !important để override mọi thứ */
    body.is-view-mode .floating-comment-btn { 
        display: flex !important;
        bottom: 100px !important; /* Move higher to avoid share bar */ 
    }

    /* OPTIMIZE MOBILE TIMELINE META DISPLAY */
    .selected-item {
        padding-right: 35px; /* Reduce padding slightly */
    }
    .selected-item img {
        width: 50px; /* Reduce thumb size */
        height: 50px;
        flex-shrink: 0;
    }
    .hotel-address {
        max-width: 100%; /* Remove width restriction */
        white-space: normal; /* Allow wrapping */
        text-align: left;
    }
    /* Ensure other meta can expand */
    .selected-item-info div[style*="font-size:0.75rem"] {
        white-space: normal !important;
        max-width: 100% !important;
    }
    
    /* UPDATE MOBILE UI FOR TOOLS BAR */
    .search-sort-wrapper {
        flex-direction: column;
    }
    #new-itin-search {
        width: 100%;
        margin-bottom: 10px;
    }
    /* Wrap select boxes in a row */
    .search-sort-wrapper select {
        width: calc(50% - 5px);
        display: inline-block;
    }
    /* Ensure select boxes are side-by-side */
    .search-sort-wrapper {
        display: block; /* Remove flex to allow inline-block children or custom flex */
    }
    .search-sort-wrapper > div.mobile-sort-row {
        display: flex;
        gap: 10px;
    }
    
    /* FIX 5: Mobile Tabs - FORCE BLOCK TO DISABLE GRID 3 COLS */
    .journeys-grid-3-col { 
        display: block !important; 
        grid-template-columns: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Hide inactive cols */
    .journey-col { display: none; } 
    /* Show active col */
    .journey-col.active { display: block !important; animation: fadeIn 0.3s; width: 100% !important; }

    /* FIX: FORCE FULL WIDTH FOR JOURNEY CARDS ON MOBILE - REVISED STRONGER */
    .journey-col .itinerary-card,
    #col-created-list .itinerary-card, 
    #col-saved-list .itinerary-card, 
    #col-draft-list .itinerary-card { 
        width: 100% !important; 
        min-width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important; /* Override flex basis if parent is flex */
        margin: 0 0 15px 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        display: flex !important; /* Keep flex for internal layout */
        flex-direction: column !important;
        height: auto !important; 
        transform: none !important; 
        border-radius: 10px !important;
    }
    
    /* FIX: Ensure container is full width and block */
    .col-list-container {
        width: 100% !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* FIX: Force full width for cards container in My Journey page */
    .journey-col {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 20px 0 !important;
        padding: 10px !important;
        background: transparent !important; /* Optional cleaner look */
        border: none !important; /* Remove border on mobile if desired */
    }

    .profile-text-info {
        min-width: 0; /* Remove constraint */
        width: 100%;
    }
    .guide-provinces-list, .profile-contact-row span, .p-contact-item {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        max-width: 100%;
        display: block; /* Ensure it takes full width to allow wrapping context */
    }
    
    .profile-page-container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* PC Adjustments */
@media (min-width: 992px) {
    /* Ensure floating button is hidden on PC even if is-view-mode class is present */
    .floating-comment-btn { display: none !important; }
    #step-comments { display: block; }
}

/* =========================================
   11. TRAVEL LIST & LEADERBOARD STYLES
   ========================================= */

/* Uppercase Header */
.section-header-title.uppercase {
    text-transform: uppercase;
    font-size: 1.4rem;
    color: var(--text-color); /* Updated to --text-color for Light/Dark mode adaptability */
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

/* ADDED: LINE BELOW LEADERBOARD TITLE */
.section-header-title.uppercase::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background-color: var(--primary-color);
    margin-right: 5px;
}

/* Grid container for travel plans */
.grid-container { display: grid; gap: 20px; }
        
/* Responsive Grids for Travel Plan (UPDATED 3 COLUMNS FOR PAGE-TRAVEL-PLAN-LIST) */
@media (min-width: 1200px) {
    .grid-lb-wrapper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
    /* NEW: 3 COLUMN LAYOUT FOR HOME & TRAVEL LIST */
    .grid-lb-wrapper.three-col-layout {
        grid-template-columns: repeat(3, 1fr);
    }
    /* FIX: Restore 4 Column Layout for PC */
    .grid-4-col { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 992px) and (max-width: 1199px) {
    .grid-4-col { grid-template-columns: repeat(4, 1fr); }
    .grid-lb-wrapper { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; } /* 2x2 on medium */
    .grid-lb-wrapper.three-col-layout { grid-template-columns: repeat(2, 1fr); } /* Fallback to 2 on smaller PC */
}
@media (min-width: 600px) and (max-width: 991px) {
    .grid-4-col { grid-template-columns: repeat(2, 1fr); }
    .grid-lb-wrapper { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .grid-lb-wrapper.three-col-layout { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 599px) {
    .grid-4-col { grid-template-columns: 1fr; }
    /* Mobile Leaderboard Tab Handling */
    .grid-lb-wrapper { display: block; }
    .lb-col { display: none; }
    .lb-col.active { display: block; animation: fadeIn 0.3s; }
    /* Fix Stacked Column on Mobile (Show only if active tab logic handles it, or hide wrapper) */
    .lb-col-stacked .lb-col { display: none; }
    .lb-col-stacked .lb-col.active { display: block; }
}

/* --- FIX MOBILE DISPLAY: FORCE SHOW STACKED COLUMNS ON HOME (S22+ FIX) --- */
@media (max-width: 991px) {
    /* Trong Trang chủ (Home), ta muốn hiển thị Users rồi đến Guides thẳng tuột */
    /* Ghi đè logic ẩn .lb-col phía trên */
    .lb-col-stacked .lb-col {
        display: block !important; /* Luôn hiện */
        margin-top: 30px;
    }
    .lb-col-stacked .lb-col:first-child {
        margin-top: 0;
    }
    
    /* FIX 2: Đồng bộ Breakpoint ẩn hiện cột Mobile */
    /* Thay đổi 599px -> 991px để khớp với sự xuất hiện của Tabs */
    .grid-lb-wrapper { display: block; }
    .lb-col { display: none; }
    .lb-col.active { display: block; animation: fadeIn 0.3s; }
    
    /* Fix Stacked Column on Mobile (Group wrapper) */
    /* By default hide group, show only if active */
    .lb-col-group { display: none; }
    .lb-col-group.active { display: block; }
    
    /* Ensure children of active group are visible */
    .lb-col-group.active .lb-col { display: block !important; margin-top: 30px; }
    .lb-col-group.active .lb-col:first-child { margin-top: 0; }
}

/* ITINERARY CARD (Based on HTML template) */
.itinerary-card {
    background: var(--card-bg); border-radius: 10px; overflow: hidden;
    box-shadow: var(--shadow); border: 1px solid var(--border-color);
    display: flex; flex-direction: column; cursor: pointer; transition: transform 0.2s; position: relative;
    height: 100%; /* Equal height */
}
.itinerary-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }

.itin-img-wrapper { height: 160px; position: relative; }
.itin-img { width: 100%; height: 100%; object-fit: cover; }
.itin-badge {
    position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.6); color: #fff;
    padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; backdrop-filter: blur(2px);
}
.itin-rating-badge {
    position: absolute; bottom: 5px; right: 5px; background: rgba(0,0,0,0.7); color: #fbc02d;
    padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: bold;
    display: flex; align-items: center; gap: 3px; backdrop-filter: blur(2px);
}

.itin-bookmark-btn {
    position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
    background: rgba(255,255,255,0.8); border-radius: 50%; display: flex;
    align-items: center; justify-content: center; cursor: pointer;
    color: #888; transition: 0.2s; z-index: 2;
}
.itin-bookmark-btn:hover { background: #fff; color: #f44336; }
.itin-bookmark-btn.active { color: #f44336; }

.itin-body { padding: 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.itin-title { font-weight: bold; font-size: 1rem; color: var(--text-color); line-height: 1.3; }
.itin-meta { font-size: 0.8rem; color: var(--text-secondary); display: center; align-items: center; gap: 10px; }
.itin-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.itin-footer {
    padding: 10px 15px; border-top: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between; background: var(--bg-color);
}
.itin-user { display: flex; align-items: center; gap: 8px; }
.itin-user-avatar { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; }
.itin-user-name { font-size: 0.85rem; font-weight: 500; color: var(--text-color); }

.itin-extra-stats { display: flex; gap: 10px; font-size: 0.75rem; color: var(--text-secondary); }
.itin-stat { display: flex; align-items: center; gap: 3px; }

/* USER CARD (Leaderboard) */
.user-card {
    background: var(--card-bg); border-radius: 10px; padding: 15px;
    border: 1px solid var(--border-color); display: flex; align-items: center; gap: 15px;
    cursor: pointer; transition: 0.2s; margin-bottom: 10px;
}
.user-card:hover { transform: translateX(5px); background: var(--menu-hover); }
.uc-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary-color); }
.uc-info { flex: 1; }
.uc-name { font-weight: bold; font-size: 1rem; color: var(--text-color); margin-bottom: 4px; }
.uc-stats { font-size: 0.8rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 2px; }
.uc-stat-row { display: flex; align-items: center; gap: 10px; }
.uc-rank { font-weight: bold; font-size: 1.2rem; color: #e65100; min-width: 25px; text-align: center; }

/* LEADERBOARD TABS (MOBILE) */
.lb-tabs { display: none; gap: 10px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 5px; }
@media (max-width: 991px) { .lb-tabs { display: flex; } }
.lb-tab-btn {
    padding: 8px 16px; border-radius: 20px; background: var(--card-bg); 
    border: 1px solid var(--border-color); white-space: nowrap; color: var(--text-color); cursor: pointer;
}
.lb-tab-btn.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* TOOLS BAR (Search Sort) */
.tools-bar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px;
    background: var(--bg-color); padding: 10px 0;
}
.search-sort-wrapper {
    display: flex; gap: 10px; flex: 1; min-width: 300px;
}
@media (max-width: 576px) {
    .search-sort-wrapper { min-width: 100%; width: 100%; }
}

/* LEADERBOARD DIVIDER LINE */
.grid-lb-wrapper {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}

/* =========================================
   12. PROFILE PAGE & JOURNEY LIST (New Layout)
   ========================================= */
.profile-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* --- FIX 1: FORCE FULL WIDTH FOR MY JOURNEY PAGE --- */
/* Override default main container styles specifically for this template */
body.page-template-page-my-journey main {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
}

/* Reset Cover Radius & Borders for Full Width Look */
.profile-header-wrapper {
    position: relative;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
    
    /* Full Width Overrides */
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    margin-bottom: 0 !important;
}

.profile-cover {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #ddd;
    border-radius: 0 !important;
}

.cover-edit-btn {
    position: absolute;
    bottom: 15px; right: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
    transition: 0.2s;
    display: flex; align-items: center; gap: 8px;
}
.cover-edit-btn:hover { background: rgba(0,0,0,0.8); }

.profile-info-bar {
    padding: 20px 0;
    position: relative;
}

/* Container to center content inside full-width sections */
.profile-inner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.profile-info-inner {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.profile-avatar-large-wrapper {
    position: relative;
    margin-top: -80px; /* Overlap cover */
    flex-shrink: 0;
}

.profile-avatar-large {
    width: 150px; height: 150px;
    border-radius: 50%;
    border: 5px solid var(--card-bg);
    object-fit: cover;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.profile-text-info {
    flex: 1;
    min-width: 300px;
    padding-bottom: 5px;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-color);
    line-height: 1.2;
}

.guide-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex; align-items: center; gap: 5px;
}

.traveler-badge {
    background: #f5f5f5;
    color: #666;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex; align-items: center; gap: 5px;
}

.profile-contact-row {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.p-contact-item {
    display: flex; align-items: center; gap: 6px;
}

/* Fix text wrapping */
.guide-provinces-list {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
    /* FIX: Force wrapping */
    white-space: normal !important;
    overflow-wrap: anywhere !important; /* Forces break even for long words/commas */
    word-break: break-word;
    width: 100%;
}

/* FIX 5: Wrap text on Mobile */
.guide-provinces-list, .profile-contact-row span, .p-contact-item {
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
}

.profile-bio {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
    margin-top: 10px;
}

.profile-actions {
    margin-left: auto;
    align-self: center;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .profile-cover { height: 200px; }
    .profile-info-inner { flex-direction: column; align-items: center; text-align: center; }
    .profile-avatar-large-wrapper { margin-top: -60px; }
    .profile-avatar-large { width: 100px; height: 100px; }
    .profile-name-row { justify-content: center; flex-wrap: wrap; }
    .profile-contact-row { justify-content: center; gap: 10px; }
    .profile-actions { margin: 15px auto 0; }
    .profile-bio { text-align: left; }
    .grid-4-col { grid-template-columns: 1fr; }
    
    /* FIX 5: Filter scroll on mobile */
    .tools-bar { flex-direction: column; align-items: flex-start; }
    .tools-bar .scroll-row {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 10px;
        order: 2; /* Put below sort on flex col, or adjust html order */
    }
    .search-sort-wrapper { width: 100%; margin-bottom: 10px; order: 1; }
    
    /* FIX 5: Mobile Tabs */
    .journeys-grid-3-col { display: block; } /* Hide grid */
    .journey-col { display: none; } /* Hide all cols */
    .journey-col.active { display: block; animation: fadeIn 0.3s; }

    /* FIX: FORCE FULL WIDTH FOR JOURNEY CARDS ON MOBILE - REVISED */
    .journey-col .itinerary-card,
    #col-created-list .itinerary-card, 
    #col-saved-list .itinerary-card, 
    #col-draft-list .itinerary-card { 
        width: 100% !important; 
        min-width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        margin-bottom: 15px !important;
        box-sizing: border-box !important;
        display: flex !important;
        height: auto !important; /* Prevent fixed height issues */
        transform: none !important; /* Reset transform effects */
    }
    
    /* FIX: Ensure container is full width */
    .col-list-container {
        width: 100% !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* FIX: Force full width for cards in My Journey page specifically */
    .journey-col {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 20px 0 !important;
        padding: 10px !important; /* Reduce padding slightly */
    }

    .profile-text-info {
        min-width: 0; /* Remove constraint */
        width: 100%;
    }
    
    .profile-page-container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* PROFILE PAGE - 3 COLUMN GRID */
.journeys-grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

.journey-col {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
    min-height: 300px;
}

.col-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
    text-transform: uppercase;
}

.col-list-container {
    min-height: 200px;
}

.mini-pagination .btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* RESPONSIVE */
@media (max-width: 991px) {
    /* .journeys-grid-3-col { grid-template-columns: 1fr; } removed to support tabs */
    .journey-col {
        margin-bottom: 20px;
    }
}

/* FIX SPACING FOR SECTION HEADER TITLE IN PROFILE */
.user-plans-section .section-header-title {
    margin-top: 40px !important;
}

/* NEW: MODAL CLOSE OUTSIDE STYLE */
.modal-close-outside {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    z-index: 100002;
    background: none;
    border: none;
    padding: 10px;
}
.modal-close-outside:hover { color: #ccc; }

/* --- BOOKMARK LOADING EFFECT --- */
.itin-bookmark-btn.loading {
    pointer-events: none;
    background: rgba(255,255,255,0.95);
}
.itin-bookmark-btn.loading i {
    display: none;
}
.itin-bookmark-btn.loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid #ddd;
    border-top-color: #d32f2f;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    display: block;
}

/* FIX 1: Adjust position (Below heart) */
.bookmark-success-text {
    position: absolute;
    top: 40px; /* Moved down below the button */
    right: 0;
    background: #4caf50;
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 10;
}
.bookmark-success-text.show {
    opacity: 1;
}

/* =========================================
   13. MEMBER LIST PAGE STYLES (NEW)
   ========================================= */
/* Slider Section */
.member-slider-container {
    position: relative;
    padding: 0 40px;
}
.member-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.member-slider::-webkit-scrollbar { display: none; }
.member-slide-item {
    flex: 0 0 220px;
    scroll-snap-align: start;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    position: relative;
    transition: transform 0.2s;
}
.member-slide-item:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.top-rank-badge {
    position: absolute; top: 10px; left: 10px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #fff; width: 28px; height: 28px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 2;
}
.top-rank-badge.rank-1 { background: linear-gradient(45deg, #FFD700, #FDB931); transform: scale(1.2); }
.top-rank-badge.rank-2 { background: linear-gradient(45deg, #C0C0C0, #E0E0E0); }
.top-rank-badge.rank-3 { background: linear-gradient(45deg, #CD7F32, #B87333); }

.slider-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 35px; height: 35px; background: var(--card-bg);
    border: 1px solid var(--border-color); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: var(--shadow); z-index: 5;
    color: var(--text-color);
}
.slider-nav-btn.prev { left: 0; }
.slider-nav-btn.next { right: 0; }
@media (max-width: 768px) {
    .member-slider-container { padding: 0; }
    .slider-nav-btn { display: none; }
    .member-slide-item { flex: 0 0 160px; padding: 10px; }
    
    /* FIX 3: Guide Filter overlap */
    #guide-region-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        display: block !important; /* Force block to ensure new line */
        white-space: nowrap;
    }
}

/* Member Grid Layouts */
.member-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
.member-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
@media (max-width: 991px) { .member-grid-5, .member-grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .member-grid-5, .member-grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* Member Card */
.member-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    height: 100%;
}
.member-card:hover { border-color: var(--primary-color); }
.m-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 5px; border: 3px solid var(--bg-color); }
.m-name { font-weight: bold; font-size: 1rem; color: var(--text-color); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.m-meta { font-size: 0.8rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 2px; }
.m-stat-row { display: flex; align-items: center; justify-content: center; gap: 5px; }
.m-guide-badge { background: #e3f2fd; color: #1565c0; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-top: 5px; }
.m-provinces { font-size: 0.75rem; color: #666; margin-top: 5px; font-style: italic; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.section-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; background: var(--menu-hover); padding: 10px; border-radius: 8px; }
.control-group { display: flex; gap: 10px; align-items: center; }

/* NEW: MEMBER LIST PAGE TOOLBAR STYLES */
.member-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-color);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap; /* Cho phép xuống dòng trên mobile */
}

/* Search Group */
.toolbar-search-group {
    flex: 1;
    min-width: 250px;
}

/* Sort & Limit Group */
.toolbar-sort-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Member Search Box */
.member-search-box {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    outline: none;
}
.member-search-box:focus { border-color: var(--primary-color); }

/* Custom Selects */
.member-sort-select, .member-limit-select {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
}

/* MOBILE RESPONSIVE FOR TOOLBAR */
@media (max-width: 768px) {
    .section-controls {
        align-items: flex-start;
    }
    .control-group.right-controls {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between; /* Sort trái, Search phải (hoặc full) */
    }
    .member-toolbar {
        flex-direction: column-reverse; /* Đảo ngược để Sort lên trên, Search xuống dưới */
        align-items: stretch;
        gap: 10px;
    }

    .toolbar-sort-group {
        width: 100%;
        display: flex;
        justify-content: space-between; /* Căn đều 2 bên */
    }

    .toolbar-search-group {
        width: 100%;
    }

    .member-sort-select {
        flex: 2; /* Sort rộng hơn chút */
    }
    .member-limit-select {
        flex: 1; /* Limit nhỏ hơn */
        min-width: 80px;
    }
}

/* =========================================
   14. TIMELINE CHECKIN SECTION & PAGE FIXES (UPDATED)
   ========================================= */

/* --- TIMELINE SECTION --- */
.timeline-section-full {
    width: 100% !important;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 40px 0;
    margin-bottom: 40px;
}

/* 1) FULL WIDTH WRAPPER FIX */
.timeline-checkin-wrapper {
    max-width: 100%; /* Force Full Width */
    margin: 0 auto;
    padding: 0 40px; /* Keep padding for aesthetic */
}

/* --- NEW DATE SELECTOR (Month/Year) --- */
.tl-date-selector-group {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    margin-bottom: 5px;
    background: #f5f5f5;
    padding: 5px;
    border-radius: 6px;
    border: 1px solid #ddd;
}
.tl-select {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 0.75rem;
    color: var(--text-color);
    background: #fff;
    cursor: pointer;
    outline: none;
    flex: 1; /* Equal width */
    min-width: 0;
}
.tl-select:focus { border-color: var(--primary-color); }

/* --- FILTERS --- */
.timeline-filters {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.tf-row {
    display: flex;
    align-items: center;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}
.tf-row::-webkit-scrollbar { height: 4px; }
.tf-row::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.tf-label {
    font-weight: bold;
    min-width: 60px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tf-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s;
    color: var(--text-color);
}
.tf-btn:hover { background: var(--menu-hover); }
.tf-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: 500;
}

/* --- TIMELINE LIST --- */
.timeline-group { margin-bottom: 30px; }
.timeline-date-header {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.timeline-item-row {
    display: grid;
    grid-template-columns: 1fr 7fr; /* 1/8 and 7/8 ratio */
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.timeline-item-row:last-child { border-bottom: none; }

/* LEFT: LOCATION CARD */
.tl-loc-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.tl-loc-img-wrapper {
    position: relative;
    height: 100px;
}
.tl-loc-img { width: 100%; height: 100%; object-fit: cover; }
.tl-loc-region {
    position: absolute; top: 5px; right: 5px;
    background: rgba(0,0,0,0.7); color: #fff;
    padding: 2px 6px; border-radius: 4px;
    font-size: 0.65rem;
}
.tl-loc-body { padding: 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.tl-loc-name { font-weight: bold; font-size: 0.9rem; line-height: 1.3; }
.tl-loc-meta { font-size: 0.7rem; color: var(--text-secondary); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.tl-loc-desc { font-size: 0.75rem; color: #666; margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tl-loc-actions { margin-top: auto; display: flex; gap: 5px; margin-top: 10px; }
.tl-btn-action {
    flex: 1; border: 1px solid var(--border-color); background: #fff;
    font-size: 0.7rem; padding: 4px; border-radius: 4px; cursor: pointer;
    text-align: center;
}
.tl-btn-action:hover { background: var(--menu-hover); color: var(--primary-color); }

/* RIGHT: SPOTS GRID (7 COLS) */
.tl-spots-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7 Columns */
    gap: 10px;
    align-content: start;
}

.tl-spot-card {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    background: #fff;
}
.tl-spot-card:hover { transform: translateY(-3px); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.tl-spot-img { width: 100%; height: 80px; object-fit: cover; }
.tl-spot-name {
    padding: 5px; font-size: 0.75rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-align: center;
}
/* Uncheck Button on Hover - REMOVED PER REQUIREMENT */
.tl-spot-remove {
    display: none !important;
}

/* RELOAD NOTICE BAR */
.reload-notice-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(51, 51, 51, 0.95);
    backdrop-filter: blur(5px);
    color: #fff;
    padding: 12px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 99999; /* Higher than modal */
    display: none;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.1);
}
.reload-notice-bar.show { display: flex; }
.reload-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.4);
    transition: all 0.2s;
    white-space: nowrap;
}
.reload-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

@keyframes slideUp {
    from { bottom: -100px; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}

/* RESPONSIVE FOR RELOAD NOTICE */
@media (max-width: 768px) {
    .reload-notice-bar {
        width: 90%;
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
        bottom: 20px;
        border-radius: 12px;
        padding: 15px;
        white-space: normal;
        flex-direction: row; /* Keep side-by-side */
        justify-content: space-between;
        text-align: left;
    }
    .reload-notice-bar span {
        font-size: 0.85rem;
        line-height: 1.4;
        flex: 1;
    }
    .reload-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* 4) SPOT DETAIL MODAL STYLE */
#spot-detail-modal .modal-content {
    max-width: 600px;
}
#spot-detail-img {
    width: 100%; height: 250px; object-fit: cover;
    border-radius: 8px 8px 0 0;
}
#spot-detail-body {
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* RESPONSIVE */
@media (max-width: 991px) {
    .timeline-item-row { grid-template-columns: 1fr; } /* Stack on tablet */
    .tl-spots-grid { grid-template-columns: repeat(4, 1fr); }
    .timeline-section-full { padding: 20px 0; }
    .timeline-checkin-wrapper { padding: 15px; }
}

@media (max-width: 768px) {
    .tl-spots-grid { grid-template-columns: repeat(3, 1fr); }
    .timeline-date-header { font-size: 1rem; flex-wrap: wrap; }
    
    /* Force filters to scroll */
    .tf-row { flex-wrap: nowrap; justify-content: flex-start; }
    
    /* Adjust Card */
    .tl-loc-img-wrapper { height: 140px; }
}

@media (max-width: 480px) {
    .tl-spots-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================
   15. CUSTOM PAGE TABS STYLES (NEW)
   ========================================= */
.custom-page-tabs-container {
    margin-top: 30px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.cp-tabs-nav {
    display: flex;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cp-tab-btn {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-color);
    white-space: nowrap;
    transition: all 0.2s;
}

.cp-tab-btn:hover {
    background: var(--menu-hover);
    color: var(--primary-color);
}

.cp-tab-btn.active {
    background: var(--card-bg);
    color: var(--primary-color);
    font-weight: bold;
    border-bottom: 2px solid var(--primary-color);
}

.cp-tab-pane {
    display: none;
    padding: 25px;
    animation: fadeIn 0.3s;
}

.cp-tab-pane.active {
    display: block;
}

/* Rich Content Style (For Guide/Feedback) */
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}
.rich-content ul, .rich-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}
.rich-content h2, .rich-content h3 {
    margin-top: 15px;
    margin-bottom: 10px;
}

/* Timeline Style (Change Log) */
.changelog-timeline {
    position: relative;
    padding-left: 30px;
}

.changelog-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.cl-item {
    position: relative;
    margin-bottom: 25px;
}

.cl-marker {
    position: absolute;
    left: -28px;
    top: 5px;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border: 3px solid var(--card-bg);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 1px var(--border-color);
}

.cl-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    position: relative;
}

.cl-content::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 10px;
    width: 10px;
    height: 10px;
    background: var(--bg-color);
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.cl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.cl-ver {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.cl-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.cl-body {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cp-tab-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    .cp-tab-pane {
        padding: 15px;
    }
}

/* ==========================================================================
   UPDATE 2024: NEW SINGLE POST DESIGN (GRAY BG & 80% CARD)
   ========================================================================== */

/* -----------------------------------------------------------
   1. SINGLE POST STRUCTURE
   ----------------------------------------------------------- */

/* Wrapper Background Xám toàn màn hình */
.single-gray-background {
    background-color: #f4f6f8; /* Màu xám nhạt hiện đại */
    width: 100%;
    padding: 50px 0 80px; /* Padding trên dưới */
}

/* Card Trắng chứa nội dung (80% width) */
.single-white-card {
    background: #ffffff;
    width: 80%; /* YÊU CẦU: Tăng lên 80% */
    max-width: 1100px; /* Giới hạn max width để không quá bè trên màn hình lớn */
    margin: 0 auto; /* Căn giữa */
    padding: 50px 60px; /* Padding trong lớn để chữ không sát lề */
    border-radius: 12px; /* Bo góc mềm mại */
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); /* Đổ bóng nhẹ tạo chiều sâu */
    position: relative;
    /* Hiệu ứng đẩy lên một chút so với nền xám */
    margin-top: -60px; 
    z-index: 10;
}

/* Riêng card comment thì không cần margin-top âm */
.single-white-card.comment-card {
    margin-top: 40px;
    padding: 40px 60px;
}

/* Responsive cho Card */
@media (max-width: 992px) {
    .single-white-card {
        width: 90%;
        padding: 40px;
    }
}
@media (max-width: 768px) {
    .single-white-card {
        width: 95%; /* Mobile gần full màn hình */
        padding: 25px 20px; /* Giảm padding trên mobile */
        margin-top: -40px;
    }
}

/* -----------------------------------------------------------
   2. HERO SECTION
   ----------------------------------------------------------- */
.single-hero-wrapper {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Phần dưới Hero sẽ bị Card che 1 chút nhờ margin-top âm */
    padding-bottom: 40px; 
}
.single-hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); /* Overlay tối 50% */
    z-index: 1;
}
.single-hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 20px;
    color: #fff;
}
.single-cat-label {
    display: inline-block;
    background: var(--primary-color, #2e7d32);
    color: #fff;
    padding: 6px 15px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.8rem;
    margin-bottom: 20px;
    letter-spacing: 1px;
}
.single-main-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    color: #fff !important;
}
.single-meta-hero {
    font-size: 1rem;
    opacity: 0.95;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}
.single-meta-hero i { margin-right: 6px; }

/* -----------------------------------------------------------
   3. CONTENT TYPOGRAPHY
   ----------------------------------------------------------- */
.entry-content.rich-content {
    font-size: 1.15rem; /* Chữ to rõ */
    line-height: 1.8; /* Dãn dòng thoáng */
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.entry-content p { margin-bottom: 1.5em; text-align: justify; }
.entry-content h2 { 
    font-size: 1.8rem; 
    font-weight: 700; 
    margin: 40px 0 20px; 
    color: #111;
}
.entry-content h3 { 
    font-size: 1.5rem; 
    font-weight: 600; 
    margin: 35px 0 15px; 
    color: #222;
}
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 30px auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.entry-content blockquote {
    border-left: 4px solid var(--primary-color, #2e7d32);
    margin: 30px 0;
    padding: 15px 25px;
    background: #f9f9f9;
    font-style: italic;
    color: #555;
}

/* -----------------------------------------------------------
   4. SHARE & TAGS
   ----------------------------------------------------------- */
.single-share-box {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}
.single-share-box .share-label { font-weight: bold; margin-right: 5px; color: #333; }
.share-btn {
    width: 36px; height: 36px;
    border-radius: 50%; border: none; color: #fff;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.share-btn:hover { transform: translateY(-3px); }
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #1da1f2; }
.share-btn.zl { background: #0068ff; width: auto; padding: 0 15px; border-radius: 18px; font-weight: bold; font-size: 0.85rem; }

.single-tags {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex; flex-wrap: wrap; gap: 10px;
}
.single-tags a {
    background: #f1f1f1; color: #555;
    padding: 6px 14px; border-radius: 20px;
    text-decoration: none; font-size: 0.9rem;
    transition: all 0.2s;
}
.single-tags a:hover { background: var(--primary-color, #2e7d32); color: #fff; }

/* -----------------------------------------------------------
   5. RELATED POSTS
   ----------------------------------------------------------- */
.related-posts-section {
    margin-top: 50px;
}
.related-container-80 {
    width: 80%;
    max-width: 1100px;
    margin: 0 auto;
}
.section-title-line {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 25px;
    padding-left: 15px;
    border-left: 4px solid var(--primary-color, #2e7d32);
    text-transform: uppercase;
}

.related-slide-wrapper {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}
.related-slide-item {
    min-width: 280px; max-width: 280px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-decoration: none; color: inherit;
    scroll-snap-align: start;
    border: 1px solid #eee;
    transition: transform 0.2s;
    display: flex; flex-direction: column;
}
.related-slide-item:hover { transform: translateY(-5px); }
.r-thumb-box { height: 160px; overflow: hidden; }
.r-thumb-box img { width: 100%; height: 100%; object-fit: cover; }
.r-title { padding: 15px 15px 5px; margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.r-date { padding: 0 15px 15px; font-size: 0.8rem; color: #999; margin-top: auto; }

/* Responsive Mobile Typography */
@media (max-width: 768px) {
    .single-main-title { font-size: 1.8rem; }
    .related-container-80 { width: 95%; }
}

/* --- SEARCH DROPDOWN STYLES (NEW) --- */
.search-dropdown-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 10000; /* Cao hơn các element khác */
    display: none;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
    font-size: 0.95rem;
    color: #333;
    display: flex;
    align-items: center;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #e8f5e9;
    color: var(--primary-color);
    font-weight: 500;
}

.search-result-item i {
    color: #999;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.search-result-item:hover i {
    color: var(--primary-color);
}


/* ==========================================================================
   CODE BỔ SUNG FIX LỖI GIAO DIỆN MỚI
   ========================================================================== */

/* -----------------------------------------------------------
   FIX 1: BLOG LIST GRID LAYOUT (page-blog.php) - 2 COLUMNS ON MOBILE
   ----------------------------------------------------------- */
/* Thiết lập khung bao ngoài */
.blog-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 cột trên PC */
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Responsive Tablet (Hiển thị 2 cột) */
@media (max-width: 992px) {
    .blog-grid-container {
        grid-template-columns: repeat(2, 1fr); /* Ép 2 cột trên Tablet */
        gap: 15px;
    }
}

/* Responsive màn hình nhỏ (1 cột theo yêu cầu) */
@media (max-width: 768px) {
    .blog-grid-container {
        grid-template-columns: 1fr; /* Hiển thị 1 cột trên Mobile */
        gap: 20px;
    }
}

/* -----------------------------------------------------------
   FIX 2: SINGLE POST COMMENT SECTION MOBILE OVERFLOW (single.php)
   ----------------------------------------------------------- */
.single-white-card.comment-card {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Ngăn chặn bất cứ nội dung con nào tràn ngang */
}

/* Sửa lại Fix 2: Không dùng overflow-x: hidden !important nữa để tránh bị lỗi mất form FB */
.facebook-comment-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #fff; /* Chuyển từ inline style vào class */
    padding: 10px;
    border-radius: 8px;
}

/* Ép iFrame của Facebook không được vượt quá 100% width của thẻ cha */
.fb-comments,
.fb-comments span,
.fb-comments iframe {
    width: 100% !important;
    max-width: 100% !important;
}

/* Giảm margin/padding cho riêng khung comment ở Mobile */
@media (max-width: 768px) {
    .single-white-card.comment-card {
        padding: 20px 15px !important; /* Thu gọn padding để có nhiều diện tích cho iframe hơn */
        width: 100% !important;
    }
    .facebook-comment-wrapper {
        padding: 5px !important; /* Loại bỏ padding thừa bên trong wrapper */
    }
}

/* -----------------------------------------------------------
   FIX 3: BLOG LIST CARD STYLING & META ALIGNMENT
   ----------------------------------------------------------- */
.blog-card-modern {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.blog-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.blog-card-thumb-wrapper {
    position: relative;
    width: 100%;
}
.blog-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}
/* Style nút Category bên phải Thumbnail */
.blog-cat-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: #fff;
    padding: 6px 14px;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    z-index: 2;
    text-decoration: none;
}
.blog-cat-badge:hover {
    background: var(--visited-color);
    color: #fff;
    transform: translateY(-2px);
}
/* Cách lề phần body bên trong thẻ Blog */
.blog-card-body {
    padding: 20px 25px; 
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}
/* Tuỳ chỉnh phần Meta của thẻ */
.blog-meta-top {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.blog-meta-top span {
    display: flex;
    align-items: center;
    gap: 5px;
}
.blog-meta-top i {
    color: var(--primary-color);
    font-size: 0.95rem;
}
.blog-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}
.blog-card-title a {
    color: var(--text-color);
    transition: color 0.2s;
}
.blog-card-title a:hover {
    color: var(--primary-color);
}
.blog-card-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Tinh chỉnh Responsive cho Card Meta */
@media (max-width: 576px) {
    .blog-card-body {
        padding: 15px 15px; 
        gap: 8px;
    }
    .blog-card-img {
        height: 220px; /* Khôi phục tỷ lệ ảnh cho thẻ 1 cột */
    }
    .blog-meta-top {
        font-size: 0.8rem;
        gap: 15px;
    }
    .blog-card-title {
        font-size: 1.1rem;
    }
    .blog-cat-badge {
        top: 15px;
        right: 15px;
        padding: 6px 14px;
        font-size: 0.75rem;
    }
}

/* -----------------------------------------------------------
   FIX 4: DARK MODE CHO TRANG CHI TIẾT (single.php)
   ----------------------------------------------------------- */
body.dark-mode .single-gray-background {
    background-color: var(--bg-color);
}
body.dark-mode .single-white-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}
body.dark-mode .entry-content.rich-content,
body.dark-mode .entry-content p,
body.dark-mode .entry-content h2,
body.dark-mode .entry-content h3,
body.dark-mode .single-share-box .share-label {
    color: var(--text-color);
}
body.dark-mode .entry-content blockquote {
    background-color: #2c2c2c;
    color: #ddd;
    border-left-color: var(--primary-color);
}
body.dark-mode .single-share-box,
body.dark-mode .single-tags {
    border-bottom-color: var(--border-color);
    border-top-color: var(--border-color);
}
body.dark-mode .single-tags a {
    background-color: #333;
    color: #e0e0e0;
}
body.dark-mode .single-tags a:hover {
    background-color: var(--primary-color);
    color: #fff;
}
body.dark-mode .section-title-line {
    color: var(--text-color);
}
body.dark-mode .related-slide-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}
body.dark-mode .r-title {
    color: var(--text-color);
}
body.dark-mode .r-date {
    color: var(--text-secondary);
}
body.dark-mode .facebook-comment-wrapper {
    /* Bắt buộc phải giữ nền trắng hoặc sáng vì Plugin FB đang set data-colorscheme="light" */
    background-color: #ffffff !important;
    border: 1px solid var(--border-color);
}
/* ==========================================================================
   TÍNH NĂNG MỚI: TOOLTIP MAP CHECKIN (HIỂN THỊ VĨNH VIỄN)
   ========================================================================== */
.map-checkin-tooltip {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.75rem;
    border-radius: 4px;
    padding: 3px 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: nowrap;
}
.map-checkin-tooltip.food-tooltip {
    border-color: #c0392b;
    color: #c0392b;
}
.map-checkin-tooltip::before {
    display: none; /* Ẩn mũi tên mặc định của leaflet tooltip nếu cần */
}
body.dark-mode .map-checkin-tooltip {
    background-color: var(--card-bg);
}

/* ==========================================================================
   QUẦN ĐẢO HOÀNG SA & TRƯỜNG SA (OVERLAY LABEL CHE MAP MẶC ĐỊNH)
   ========================================================================== */
.vietnam-island-label {
    background-color: #aad3df; /* Màu tương đồng với màu nước biển mặc định của OSM */
    color: #1e3a8a; /* Màu xanh đậm để dễ đọc */
    font-weight: bold;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.5);
    white-space: nowrap;
    text-align: center;
    box-shadow: 0 0 10px #aad3df, 0 0 20px #aad3df; /* Glow mạnh để che mờ viền chữ Trung Quốc bị thừa */
    z-index: 400 !important; /* Dưới popup nhưng trên map tiles */
    pointer-events: none; /* Không block sự kiện chuột trên map */
}
body.dark-mode .vietnam-island-label {
    background-color: #222; /* Phù hợp nếu có dùng filter dark map sau này */
    color: #fff;
    box-shadow: 0 0 10px #222;
}

/* ==========================================================================
   FIX UI: DARK MODE DATE PICKER & SELECTION MODAL GRID (TẠO LỊCH TRÌNH)
   ========================================================================== */

/* 1. Fix icon lịch sáng lên trong chế độ Dark Mode */
body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* 2. Ép layout lưới (Grid) cho Modal Chọn Điểm/Món ăn giống hệt trang chi tiết */
.select-grid {
    display: grid !important;
    gap: 15px !important;
    max-height: 60vh !important;
    overflow-y: auto !important;
    padding: 5px !important;
    background: transparent !important;
}

/* Responsive Grid 3 cột trên PC, 2 cột Tablet, 1 cột Mobile */
@media (min-width: 992px) { .select-grid { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 991px) { .select-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 768px) { .select-grid { grid-template-columns: 1fr !important; } }

/* 3. Chỉnh lại form dáng của thẻ Card trong Modal */
.select-item-card {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden;
    align-items: stretch !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}
.select-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.select-item-card.selected {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px var(--primary-color) !important;
}

/* Check indicator nằm đè giữa ảnh khi được chọn */
.select-item-card .check-indicator {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0) !important;
    width: 50px !important;
    height: 50px !important;
    background: rgba(46, 125, 50, 0.9) !important;
    color: #fff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.5rem !important;
    z-index: 10 !important;
    border: 2px solid #fff !important;
    transition: transform 0.2s ease-out !important;
}
.select-item-card.selected .check-indicator {
    transform: translate(-50%, -50%) scale(1) !important;
}

/* ==========================================================================
   CUSTOM COMMENT SYSTEM (THAY THẾ FACEBOOK)
   ========================================================================== */
#checkin-custom-comments-wrapper {
    /* Đã xóa background, padding và border để không bị viền lồng viền */
    margin-top: 15px;
}

.custom-comment-form-box {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.cmt-user-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}
@media(max-width: 576px) {
    .cmt-user-info-row { grid-template-columns: 1fr; gap: 10px; }
}

#custom-comment-form input[type="text"],
#custom-comment-form input[type="email"],
#custom-comment-form textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    outline: none;
}
#custom-comment-form input:focus, #custom-comment-form textarea:focus {
    border-color: var(--primary-color);
}
#custom-comment-form textarea {
    height: 100px;
    resize: vertical;
    margin-bottom: 10px;
}

.cmt-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.cmt-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.cmt-options input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary-color); }

/* Comment List */
.comment-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.cmt-avatar img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eee;
}
.cmt-body { flex: 1; }
.cmt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}
.cmt-author { font-weight: bold; color: var(--text-color); font-size: 0.95rem; }
.cmt-date { font-size: 0.75rem; color: #888; }
.cmt-content { font-size: 0.95rem; color: var(--text-color); line-height: 1.5; margin-bottom: 5px; }
.btn-reply-txt {
    background: none;
    border: none;
    padding: 0;
    color: #1976d2;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}
.btn-reply-txt:hover { text-decoration: underline; }

/* Children (Replies) */
.cmt-children {
    margin-top: 15px;
    padding-left: 15px;
    border-left: 2px solid #eee;
}
body.dark-mode .cmt-children { border-left-color: #444; }

/* Move form inside reply */
.comment-item .custom-comment-form-box {
    margin-top: 15px;
    margin-bottom: 0;
    animation: fadeIn 0.3s ease;
}

/* ==========================================================================
   BẢN CẬP NHẬT TỔNG HỢP (GỘP TẤT CẢ CÁC FIX VÀ TỐI ƯU HÓA)
   ========================================================================== */

/* 1. HEADER & MENU MOBILE (Khắc phục lỗi lẹm header, menu bị đè) */
header {
    z-index: 2147483647 !important; /* Layer cao nhất */
    position: fixed !important; /* Dùng Fixed thay vì Sticky để chống lẹm tuyệt đối */
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

body {
    padding-top: 80px !important; /* Đẩy nội dung xuống tránh bị header cố định đè lên */
}

.mobile-menu-overlay {
    z-index: 2147483646 !important; /* Nằm ngay dưới mép Header */
    position: fixed !important;
    top: 80px !important;
    height: calc(100vh - 80px) !important;
    padding-top: 20px !important;
    transform: translateZ(0) !important; /* Chống lỗi phân lớp 3D của trình duyệt */
}

.header-right-mobile .menu-item .sub-menu {
    z-index: 2147483646 !important;
    position: fixed !important;
    top: 80px !important;
}

/* Đẩy layer của bài viết trang Page xuống để không đè menu */
body.page-template-default main,
body.page-template-default article,
.custom-page-tabs-container {
    z-index: 1 !important;
    position: relative !important;
}


/* 2. DARK MODE: ÉP MÀU CHO Ô COPY LINK */
body.dark-mode input.form-control[readonly],
body.dark-mode input#share-link-input,
body.dark-mode .section-card input[readonly],
body.dark-mode input[readonly] {
    background-color: #2c2c2c !important;
    color: #ffffff !important;
    border-color: #444 !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}


/* 3. HIỂN THỊ COMMENT & RESPONSIVE TABS (MOBILE) */
#checkin-custom-comments-wrapper,
.custom-comment-form-box,
#custom-comment-list {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 991px) {
    /* Hiển thị comment lịch trình trên mobile */
    html body #step-comments,
    html body.is-view-mode #step-comments { 
        display: block !important; 
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Ẩn nút nổi màu xanh (Bottom sheet) */
    html body .floating-comment-btn,
    html body .comment-bottom-sheet { 
        display: none !important; 
    }

    /* Đánh giá sao xuống dòng so với tiêu đề */
    #step-comments .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    /* Chỉnh khoảng cách thẩm mỹ cho khung comment */
    #checkin-custom-comments-wrapper {
        margin-top: 10px !important;
        padding-top: 10px !important;
    }
}

@media (max-width: 768px) {
    /* Full màn hình cho thẻ Card Page mặc định */
    body.page-template-default main { padding: 0 !important; margin-top: 0 !important; }
    body.page-template-default article { border-left: none !important; border-right: none !important; border-radius: 0 !important; box-shadow: none !important; }
    body.page-template-default .entry-header { padding: 20px 15px !important; }
    body.page-template-default .entry-content { padding: 15px !important; }

    /* Full màn hình cho Custom Tabs */
    .custom-page-tabs-container { border-left: none !important; border-right: none !important; border-bottom: none !important; border-radius: 0 !important; box-shadow: none !important; margin-top: 10px !important; }
    .cp-tab-pane { padding: 20px 15px !important; }
    
    /* Bỏ viền khung nhập comment trong Tab */
    body.page-template-default .custom-comment-form-box { border-left: none !important; border-right: none !important; border-radius: 0 !important; padding-left: 0 !important; padding-right: 0 !important; background: transparent !important; }
}