/* ============================================================
   CHECKIN VIETNAM — Light Earthy Theme (Terracotta & Sage)
   ============================================================ */

/* ============ CSS VARIABLES ============ */
:root {
    --bg-primary: #faf6f0;
    --bg-secondary: #f0ebe3;
    --bg-glass: rgba(250, 246, 240, 0.92);
    --text-primary: #3a3028;
    --text-secondary: #7a6e5e;
    --text-muted: #a89880;
    --accent: #c4845a;
    --accent-light: #d4956a;
    --accent-glow: rgba(196, 132, 90, 0.2);
    --accent-secondary: #b89840;
    --visited: #6b9448;
    --visited-light: #7da858;
    --visited-glow: rgba(107, 148, 72, 0.2);
    --danger: #c45a5a;
    --success: #6b9448;
    --border-color: rgba(140, 120, 90, 0.12);
    --sidebar-width: 440px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 14px;
    --radius-sm: 10px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ RESET ============ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============ LOADING OVERLAY ============ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #f5efe6 0%, #faf6f0 50%, #f0ebe3 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(140, 120, 90, 0.12);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.loading-text {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============ MAP ============ */
#map {
    position: absolute;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    z-index: 1;
    background: var(--bg-primary);
    transition: left 0.4s var(--ease);
}

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(28px) saturate(120%);
    -webkit-backdrop-filter: blur(28px) saturate(120%);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s var(--ease);
    overflow: hidden;
    box-shadow: 2px 0 24px rgba(100, 80, 50, 0.06);
    will-change: transform;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar.collapsed~#map {
    left: 0;
}

/* --- User Profile Section --- */
.user-profile {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(140, 120, 90, 0.03);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(140, 120, 90, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-auth {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-auth:hover {
    background: rgba(140, 120, 90, 0.08);
    color: var(--text-primary);
    border-color: rgba(196, 132, 90, 0.3);
}

.btn-auth:active {
    transform: scale(0.96);
}

/* --- Sidebar Header --- */
.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-header h1 {
    font-size: 21px;
    font-weight: 800;
    background: linear-gradient(135deg, #b87040 0%, #b89840 50%, #6b9448 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.4px;
    line-height: 1.3;
}

.sidebar-header .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
    letter-spacing: 0.3px;
}

/* --- Stats Section --- */
.stats-section {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
}

.stats-number {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -2.5px;
    line-height: 1;
}

.stats-number #visited-count {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-separator {
    color: var(--text-muted);
    margin: 0 2px;
    font-weight: 300;
    font-size: 32px;
}

.stats-number #total-count {
    color: var(--text-muted);
    font-size: 26px;
    font-weight: 600;
}

.stats-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* --- Progress Bar --- */
.progress-bar-container {
    height: 5px;
    background: rgba(140, 120, 90, 0.08);
    border-radius: 3px;
    margin-top: 18px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary), var(--visited));
    background-size: 200% 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 1s var(--ease);
    position: relative;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.45) 50%,
            transparent 100%);
    animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(200%);
    }
}

.progress-percent {
    font-size: 12px;
    color: var(--accent);
    margin-top: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* --- Visited List --- */
.visited-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px 16px 0 24px;
}

.visited-list-section h2 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
    padding-right: 8px;
}

.visited-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.visited-list::-webkit-scrollbar {
    width: 3px;
}

.visited-list::-webkit-scrollbar-track {
    background: transparent;
}

.visited-list::-webkit-scrollbar-thumb {
    background: rgba(140, 120, 90, 0.18);
    border-radius: 2px;
}

.visited-list::-webkit-scrollbar-thumb:hover {
    background: rgba(140, 120, 90, 0.3);
}

/* Visited Item */
.visited-item {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
    margin-bottom: 1px;
    position: relative;
}

.visited-item:hover {
    background: rgba(196, 132, 90, 0.08);
}

.visited-item:active {
    transform: scale(0.98);
}

.visited-item::after {
    content: '→';
    position: absolute;
    right: 12px;
    color: var(--accent);
    font-size: 14px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.visited-item:hover::after {
    opacity: 0.5;
    transform: translateX(0);
}

.visited-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--visited);
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--visited-glow);
    animation: pulse-dot 3s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 5px var(--visited-glow);
    }

    50% {
        box-shadow: 0 0 12px var(--visited-glow);
    }
}

.visited-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.1px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 2;
}

.empty-state small {
    color: var(--text-muted);
    font-size: 12px;
}

/* --- Sidebar Actions --- */
.sidebar-actions {
    padding: 14px 24px 18px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(140, 120, 90, 0.04);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.2px;
}

.btn:hover {
    background: rgba(140, 120, 90, 0.08);
    color: var(--text-primary);
}

.btn:active {
    transform: scale(0.97);
}

.btn-export:hover {
    border-color: rgba(196, 132, 90, 0.4);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(196, 132, 90, 0.08);
}

.btn-reset:hover {
    border-color: rgba(196, 90, 90, 0.35);
    color: var(--danger);
    box-shadow: 0 0 12px rgba(196, 90, 90, 0.06);
}

.btn.success {
    border-color: rgba(107, 148, 72, 0.4);
    color: var(--success);
    box-shadow: 0 0 12px rgba(107, 148, 72, 0.08);
}

/* ============ SIDEBAR TOGGLE ============ */
.sidebar-toggle {
    position: fixed;
    top: 16px;
    left: calc(var(--sidebar-width) + 12px);
    z-index: 1001;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), left 0.4s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(100, 80, 50, 0.06);
}

.sidebar-toggle:hover {
    background: rgba(140, 120, 90, 0.08);
    border-color: rgba(196, 132, 90, 0.3);
}

.sidebar.collapsed~.sidebar-toggle {
    left: 12px;
}

/* ============ MAP ELEMENTS ============ */

/* Province Labels (dark text on light map) */
.province-label {
    font-size: 10.5px;
    font-weight: 600;
    color: rgba(60, 50, 35, 0.75);
    background: transparent;
    padding: 1px 5px;
    white-space: nowrap;
    pointer-events: none;
    text-shadow:
        0 0 6px rgba(255, 250, 240, 0.9),
        0 1px 3px rgba(255, 250, 240, 0.95),
        0 0 12px rgba(255, 250, 240, 0.6);
    letter-spacing: 0.4px;
}

/* Island Labels (warm brown/gold) */
.island-label {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #8a6e30;
    pointer-events: none;
    text-shadow:
        0 0 10px rgba(255, 250, 240, 0.8),
        0 0 20px rgba(255, 250, 240, 0.5);
    line-height: 1.5;
    letter-spacing: 0.5px;
}

/* Hover Tooltip */
.province-tooltip {
    font-family: var(--font) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    background: rgba(255, 252, 247, 0.96) !important;
    border: 1px solid rgba(140, 120, 90, 0.15) !important;
    border-radius: 8px !important;
    padding: 6px 14px !important;
    box-shadow: 0 4px 16px rgba(100, 80, 50, 0.1) !important;
    white-space: nowrap;
}

.province-tooltip::before {
    border-top-color: rgba(255, 252, 247, 0.96) !important;
}

.island-sublabel {
    font-size: 10px;
    color: rgba(138, 110, 48, 0.65);
    font-weight: 500;
    letter-spacing: 1px;
    margin-top: 2px;
}

.island-flag {
    font-size: 18px;
    margin-top: 4px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* Leaflet SVG Path Transitions */
.leaflet-interactive {
    transition: fill-opacity 0.35s ease,
        fill 0.35s ease,
        stroke 0.3s ease,
        stroke-width 0.3s ease;
}

/* ============ POPUP LIGHT THEME ============ */
.leaflet-popup-content-wrapper {
    background: rgba(255, 252, 247, 0.97) !important;
    color: var(--text-primary) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(140, 120, 90, 0.12) !important;
    box-shadow:
        0 8px 32px rgba(100, 80, 50, 0.12),
        0 2px 8px rgba(100, 80, 50, 0.06) !important;
}

.leaflet-popup-tip {
    background: rgba(255, 252, 247, 0.97) !important;
}

.leaflet-popup-content {
    font-family: var(--font) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    margin: 12px 16px !important;
}

.leaflet-popup-close-button {
    color: var(--text-muted) !important;
    font-size: 20px !important;
}

.leaflet-popup-close-button:hover {
    color: var(--text-primary) !important;
}

.popup-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-content strong {
    font-size: 15px;
    letter-spacing: -0.2px;
    font-weight: 700;
    color: var(--text-primary);
}

.popup-status {
    font-size: 11.5px;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.popup-status.visited {
    background: rgba(107, 148, 72, 0.12);
    color: #4a7a28;
}

.popup-status.not-visited {
    background: rgba(140, 120, 90, 0.08);
    color: var(--text-secondary);
}

/* ============ LEAFLET CONTROLS LIGHT ============ */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 12px rgba(100, 80, 50, 0.1) !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: rgba(255, 252, 247, 0.95) !important;
    color: var(--text-primary) !important;
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    font-size: 16px !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition);
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(240, 235, 227, 1) !important;
    color: var(--accent) !important;
}

/* Hide default attribution */
.leaflet-control-attribution {
    display: none !important;
}

/* ============ SIDEBAR VIEWS ============ */
.sidebar-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: slideIn 0.3s var(--ease);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============ PROVINCE DETAIL PANEL ============ */
.detail-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 2px;
    transition: var(--transition);
    letter-spacing: 0.2px;
}

.btn-back:hover {
    color: var(--accent-light);
    transform: translateX(-3px);
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 28px;
    scroll-behavior: smooth;
}

.detail-body::-webkit-scrollbar {
    width: 3px;
}

.detail-body::-webkit-scrollbar-track {
    background: transparent;
}

.detail-body::-webkit-scrollbar-thumb {
    background: rgba(140, 120, 90, 0.18);
    border-radius: 2px;
}

/* Hero Image */
.detail-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 18px;
    background: rgba(140, 120, 90, 0.06);
    flex-shrink: 0;
}

.detail-image-container.hidden {
    display: none;
}

.detail-image-container.loading {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {

    0%,
    100% {
        background: rgba(140, 120, 90, 0.06);
    }

    50% {
        background: rgba(140, 120, 90, 0.12);
    }
}

.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--ease), opacity 0.4s ease;
    opacity: 0;
}

.detail-image.loaded {
    opacity: 1;
}

.detail-image-container:hover .detail-image.loaded {
    transform: scale(1.04);
}

.detail-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(250, 246, 240, 0.6), transparent);
    pointer-events: none;
}

.detail-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.detail-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    line-height: 1.2;
}

.detail-region-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: rgba(196, 132, 90, 0.12);
    color: var(--accent);
    white-space: nowrap;
}

.detail-desc {
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Toggle Visited Button */
.btn-toggle-visited {
    width: 100%;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}

.btn-toggle-visited.is-visited {
    background: rgba(107, 148, 72, 0.12);
    border-color: rgba(107, 148, 72, 0.3);
    color: #4a7a28;
}

.btn-toggle-visited.is-visited:hover {
    background: rgba(196, 90, 90, 0.1);
    border-color: rgba(196, 90, 90, 0.3);
    color: var(--danger);
}

.btn-toggle-visited.not-visited {
    background: rgba(196, 132, 90, 0.1);
    border-color: rgba(196, 132, 90, 0.3);
    color: var(--accent);
}

.btn-toggle-visited.not-visited:hover {
    background: rgba(107, 148, 72, 0.12);
    border-color: rgba(107, 148, 72, 0.3);
    color: #4a7a28;
}

/* Stats Grid */
.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

.detail-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 6px;
    border-radius: var(--radius-sm);
    background: rgba(140, 120, 90, 0.04);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.detail-stat:hover {
    background: rgba(140, 120, 90, 0.08);
    transform: translateY(-1px);
}

.detail-stat-icon {
    font-size: 18px;
}

.detail-stat-value {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.detail-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Sections */
.detail-section {
    margin-bottom: 20px;
}

.detail-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 0.1px;
}

.detail-specialty {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    padding: 10px 14px;
    background: rgba(196, 152, 64, 0.06);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-secondary);
}

.detail-landmarks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-landmark-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(140, 120, 90, 0.04);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.detail-landmark-item:hover {
    background: rgba(196, 132, 90, 0.1);
    border-color: rgba(196, 132, 90, 0.25);
    transform: translateX(3px);
}

.detail-landmark-item .landmark-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.detail-landmark-item .landmark-text {
    flex: 1;
}

.detail-landmark-item .landmark-arrow {
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.detail-landmark-item:hover .landmark-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.detail-landmark-item .landmark-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(160, 140, 110, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 850;
    color: transparent;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
    cursor: pointer;
    background: transparent;
    flex-shrink: 0;
}

.detail-landmark-item .landmark-checkbox:hover {
    border-color: var(--accent);
    background: rgba(196, 132, 90, 0.08);
}

.detail-landmark-item .landmark-checkbox.checked {
    border-color: #8baa6a;
    background: #8baa6a;
    color: #ffffff;
    box-shadow: 0 0 6px rgba(139, 170, 106, 0.3);
}

/* Conquered state in sidebar */
.detail-landmark-item.conquered {
    background: rgba(139, 170, 106, 0.04);
    border-color: rgba(139, 170, 106, 0.25);
}

.detail-landmark-item.conquered:hover {
    background: rgba(139, 170, 106, 0.08);
    border-color: rgba(139, 170, 106, 0.4);
}

/* ============ MAP LANDMARK MARKERS ============ */
.landmark-marker.conquered {
    background: linear-gradient(135deg, #8baa6a 0%, #558038 100%) !important;
    border-color: #558038 !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 13px !important;
    box-shadow: 0 0 10px rgba(139, 170, 106, 0.5) !important;
}

.landmark-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    background: rgba(255, 252, 247, 0.95);
    border: 2px solid rgba(196, 132, 90, 0.4);
    box-shadow: 0 2px 10px rgba(100, 80, 50, 0.15);
    cursor: pointer;
    transition: all 0.25s ease;
    animation: markerPop 0.4s var(--ease);
}

@keyframes markerPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.landmark-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(100, 80, 50, 0.25);
}

.landmark-marker.type-unesco {
    border-color: rgba(180, 120, 40, 0.6);
    background: rgba(255, 248, 230, 0.95);
}

.landmark-marker.type-nature {
    border-color: rgba(107, 148, 72, 0.5);
    background: rgba(240, 255, 235, 0.95);
}

.landmark-marker.type-beach {
    border-color: rgba(70, 150, 200, 0.5);
    background: rgba(235, 248, 255, 0.95);
}

.landmark-marker.type-culture {
    border-color: rgba(160, 90, 160, 0.5);
    background: rgba(250, 240, 255, 0.95);
}

.landmark-marker.type-history {
    border-color: rgba(180, 80, 80, 0.5);
    background: rgba(255, 240, 240, 0.95);
}

.landmark-marker.type-attraction {
    border-color: rgba(200, 150, 50, 0.5);
    background: rgba(255, 250, 235, 0.95);
}

/* Landmark tooltip */
.landmark-tooltip {
    font-family: var(--font) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    background: rgba(255, 252, 247, 0.96) !important;
    border: 1px solid rgba(140, 120, 90, 0.15) !important;
    border-radius: 8px !important;
    padding: 5px 12px !important;
    box-shadow: 0 3px 12px rgba(100, 80, 50, 0.1) !important;
    white-space: nowrap;
}

/* ============ UNIFIED MAP CONTROLS ============ */
.map-controls {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(100, 80, 50, 0.1);
    border-radius: var(--radius-sm);
    padding: 4px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.map-ctrl-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
    font-size: 15px;
}

.map-ctrl-btn:hover {
    background: rgba(140, 120, 90, 0.08);
    color: var(--accent);
}

.map-ctrl-btn:active {
    transform: scale(0.95);
}

/* Specific styling for active landmark pin button */
.map-ctrl-btn#btn-toggle-landmarks.active {
    background: rgba(196, 132, 90, 0.12);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(196, 132, 90, 0.2);
}

.map-ctrl-btn svg {
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.map-ctrl-btn:hover svg {
    transform: scale(1.05);
}

/* Hide default leaflet zoom */
.leaflet-control-zoom {
    display: none !important;
}

/* ============ RESPONSIVE ============ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 25, 20, 0.4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s var(--ease);
    backdrop-filter: blur(2.5px);
    -webkit-backdrop-filter: blur(2.5px);
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 300px;
    }

    #map {
        left: 0 !important;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        box-shadow: 4px 0 32px rgba(100, 80, 50, 0.12);
    }

    .sidebar.collapsed~.sidebar-toggle {
        left: 12px;
    }

    .sidebar:not(.collapsed)~.sidebar-toggle {
        left: calc(var(--sidebar-width) + 12px);
    }

    .sidebar-header h1 {
        font-size: 19px;
    }

    .stats-number {
        font-size: 38px;
    }

    .detail-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    /* Bigger touch targets on mobile */
    .map-controls {
        bottom: 16px;
        right: 16px;
    }

    .map-ctrl-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .info-help-container {
        top: 16px;
        right: 16px;
    }

    .info-help-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    /* Wrap badge names on mobile to avoid truncation */
    .ach-badge-name {
        white-space: normal;
        line-height: 1.15;
        font-size: 9px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 85vw;
    }
}

/* ============ INFO HELP TOOLTIP (TOP RIGHT) ============ */
.info-help-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1001;
    display: inline-block;
}

.info-help-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 25, 20, 0.25);
    /* 25% opacity for see-through effect */
    backdrop-filter: blur(4px);
    /* Very low blur to see through */
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    /* White exclamation mark */
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    padding: 0;
}

.info-help-btn:hover {
    background: rgba(30, 25, 20, 0.5);
    color: #ffffff;
    /* Keep exclamation mark white on hover */
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.info-help-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    padding: 20px;
    background: rgba(30, 25, 20, 0.45);
    /* 45% opacity for highly transparent background */
    backdrop-filter: blur(5px);
    /* Gentle blur to keep text legible while fully see-through */
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.15);
    font-family: var(--font);
    color: #ffffff;
    /* White text */
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
    z-index: 1002;
}

/* Show popup on hover container */
.info-help-container:hover .info-help-popup {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.info-help-popup h3 {
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 12px;
    color: #ffb77d;
    /* Bright vibrant light orange for high contrast readability */
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 8px;
    letter-spacing: -0.3px;
}

.info-popup-body {
    font-size: 12.5px;
    line-height: 1.55;
}

.info-popup-body p {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.7);
}

.info-popup-group {
    margin-top: 14px;
}

.info-popup-group h5 {
    font-size: 13px;
    font-weight: 750;
    color: #ffffff;
    /* White sub-headings */
}

.info-popup-group p {
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}



/* ============ ACHIEVEMENTS (SIMPLIFIED) ============ */
.achievements-section-simple {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
}

.achievements-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.achievements-section-simple h2 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin: 0;
    font-weight: 700;
}

.btn-arrow-detail {
    background: none;
    border: none;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s var(--ease);
}

.btn-arrow-detail:hover {
    color: var(--accent);
    background: rgba(180, 160, 130, 0.1);
    transform: translateX(3px);
}

.achievements-carousel-wrapper {
    overflow: hidden;
    width: 100%;
    padding: 6px 2px 4px;
    margin: -6px -2px -4px;
}

.achievements-carousel {
    display: flex;
    transition: transform 0.4s var(--ease);
    width: 100%;
    will-change: transform;
}

.achievements-page {
    width: 100%;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 10px;
    padding: 2px;
    align-items: start;
}

.achievements-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.pag-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    background: rgba(140, 120, 90, 0.2);
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.pag-dot:hover {
    background: var(--accent-light);
}

.pag-dot.active {
    background: var(--accent);
    transform: scale(1.25);
}

.vietnam-flag-icon {
    width: 24px;
    height: 24px;
    display: block;
    border-radius: 50%;
    overflow: hidden;
}

/* ============ ACHIEVEMENTS DETAIL PANEL ============ */
.achievements-detail-body {
    padding-bottom: 40px !important;
}

.achievements-detail-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

@keyframes highlightGlow {
    0% {
        box-shadow: 0 0 0 rgba(196, 132, 90, 0);
        transform: scale(1);
    }

    30% {
        box-shadow: 0 0 20px rgba(196, 132, 90, 0.45);
        border-color: var(--accent);
        transform: scale(1.015);
    }

    100% {
        box-shadow: 0 0 0 rgba(196, 132, 90, 0);
        transform: scale(1);
    }
}

.ach-detail-item.highlight-pulse {
    animation: highlightGlow 1.8s var(--ease);
    z-index: 10;
}

.ach-detail-item {
    display: flex;
    gap: 16px;
    background: rgba(255, 252, 247, 0.4);
    border: 1px solid rgba(180, 160, 130, 0.12);
    border-radius: var(--radius-sm);
    padding: 16px;
    align-items: flex-start;
    transition: all 0.3s var(--ease);
}

.ach-detail-item:not(.locked) {
    border-color: rgba(139, 170, 106, 0.35);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 16px rgba(139, 170, 106, 0.08);
}

.ach-detail-icon {
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(180, 160, 130, 0.06);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: all 0.3s var(--ease);
}

.ach-detail-item:not(.locked) .ach-detail-icon {
    background: rgba(139, 170, 106, 0.12);
    border-color: rgba(139, 170, 106, 0.3);
}

.ach-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ach-detail-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ach-detail-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.ach-detail-item:not(.locked) .ach-detail-title {
    color: #558038;
}

.ach-detail-status {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.ach-detail-item:not(.locked) .ach-detail-status {
    color: #558038;
}

.ach-detail-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.ach-detail-provinces {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.ach-detail-prov-tag {
    font-size: 10.5px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.ach-detail-prov-tag:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(180, 160, 130, 0.12);
}

.ach-detail-prov-tag.visited {
    background: rgba(139, 170, 106, 0.1);
    color: #558038;
    border: 1px solid rgba(139, 170, 106, 0.2);
}

.ach-detail-prov-tag.visited:hover {
    background: rgba(139, 170, 106, 0.15);
    border-color: rgba(139, 170, 106, 0.35);
    box-shadow: 0 4px 12px rgba(139, 170, 106, 0.18);
}

.ach-detail-prov-tag.missing {
    background: rgba(180, 160, 130, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(180, 160, 130, 0.12);
    opacity: 0.75;
}

.ach-detail-prov-tag.missing:hover {
    background: rgba(180, 160, 130, 0.1);
    border-color: rgba(180, 160, 130, 0.25);
    opacity: 1;
}

.ach-badge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.ach-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(180, 160, 130, 0.08);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s var(--ease), filter 0.3s var(--ease), opacity 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
    filter: grayscale(100%);
    opacity: 0.35;
    will-change: transform;
}

.ach-badge:hover {
    transform: scale(1.12);
}

/* Unlocked State */
.ach-badge:not(.locked) {
    filter: none;
    opacity: 1;
    background: rgba(139, 170, 106, 0.16);
    border-color: #8baa6a;
    box-shadow: 0 4px 12px rgba(139, 170, 106, 0.25);
}

.ach-badge-name {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    margin-top: 2px;
}

.ach-badge-progress {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 1px;
}

.ach-badge-progress.completed {
    color: #558038;
    font-weight: 800;
}

/* ============ MASTER ACHIEVEMENTS HIGHLIGHT ============ */
.ach-badge-container:has(#ach-master-tinh),
.ach-badge-container:has(#ach-master-landmark),
.ach-badge-container:has(#ach-master-trek),
.ach-badge-container:has(#ach-master-vqg) {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 12px;
    padding: 8px 6px 6px;
    box-shadow: 0 3px 8px rgba(212, 175, 55, 0.06);
    transform: translateY(-2px);
    transition: all 0.3s var(--ease);
}

.ach-badge-container:has(#ach-master-tinh):hover,
.ach-badge-container:has(#ach-master-landmark):hover,
.ach-badge-container:has(#ach-master-trek):hover,
.ach-badge-container:has(#ach-master-vqg):hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.45);
}

.ach-badge-container:has(#ach-master-tinh) .ach-badge-name,
.ach-badge-container:has(#ach-master-landmark) .ach-badge-name,
.ach-badge-container:has(#ach-master-trek) .ach-badge-name,
.ach-badge-container:has(#ach-master-vqg) .ach-badge-name {
    color: #a38018 !important;
    /* Gold text */
    font-weight: 800;
}

#ach-master-tinh.ach-badge,
#ach-master-landmark.ach-badge,
#ach-master-trek.ach-badge,
#ach-master-vqg.ach-badge {
    border: 2px dashed rgba(212, 175, 55, 0.4) !important;
    background: rgba(212, 175, 55, 0.02) !important;
}

#ach-master-tinh.ach-badge:not(.locked),
#ach-master-landmark.ach-badge:not(.locked),
#ach-master-trek.ach-badge:not(.locked),
#ach-master-vqg.ach-badge:not(.locked) {
    border: 2px solid #d4af37 !important;
    background: rgba(212, 175, 55, 0.15) !important;
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.45) !important;
    filter: none;
    opacity: 1;
}

#ach-master-tinh.ach-badge:not(.locked)+.ach-badge-name+.ach-badge-progress,
#ach-master-landmark.ach-badge:not(.locked)+.ach-badge-name+.ach-badge-progress,
#ach-master-trek.ach-badge:not(.locked)+.ach-badge-name+.ach-badge-progress,
#ach-master-vqg.ach-badge:not(.locked)+.ach-badge-name+.ach-badge-progress {
    color: #a38018 !important;
}

/* ============ MAP FOOD MARKER ============ */
.food-marker-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    /* Plain text emoji */
    cursor: pointer;
    transition: opacity 0.2s var(--ease);
}

.food-marker-simple span {
    display: block;
    transition: transform 0.2s var(--ease);
}

.food-marker-simple:hover span {
    transform: scale(1.35);
    /* Scale the child span, preserving Leaflet's parent translate transform */
}

/* Visited vs Unvisited Food Opacity */
.food-marker-simple.visited {
    opacity: 1.0;
}

.food-marker-simple.unvisited {
    opacity: 0.35;
    /* Faded for locked foods */
}

/* Specialty Tooltip Styling */
.food-tooltip {
    background: rgba(30, 25, 20, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: var(--radius-sm) !important;
    color: #ffffff !important;
    font-family: var(--font) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 6px 10px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    pointer-events: none !important;
    /* Avoid mouse-hover triggering enter/leave loops */
}

.food-tooltip::before {
    border-top-color: rgba(30, 25, 20, 0.9) !important;
}