/* ========================================
   VARIABLES & RESET
   ======================================== */
:root {
    /* Light Theme Colors - DINCO Brand Colors */
    --primary-color: #004a8f;
    /* DINCO Blue */
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ed3237;
    /* DINCO Red */
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-tertiary: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    /* DINCO text */
    --text-body: #424141;

    /* DINCO - zone - info */
    --breadcrumb-bg-color: #aedcfd;
    --widget-color: #ed3237;
    --metric-color: #f3f4f6;
    --metric-border-color: #fdfdfd;

    /* Icon Colors */
    --color-industrial: #3b82f6;
    --color-airport: #8b5cf6;
    --color-seaport: #06b6d4;
    --color-admin: #f59e0b;
    --color-hotel: #ec4899;

    /* Sizes */
    --header-height: 70px;
    --sidebar-width: 360px;
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --primary-color: #004a8f;
    /* DINCO Blue (lighter for dark mode) */
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ed3237;
    /* DINCO Red */
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: #4b5563;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

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

/* ========================================
   MAP CONTAINER
   ======================================== */
/* .map-container now handled by Tailwind classes (fixed positioning) */

#map {
    width: 100%;
    height: 100%;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity var(--transition-speed);
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 1rem;
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

/* Map Controls */
.map-controls {
    position: absolute;
    bottom: 28px;
    right: 50px;
    display: flex;
    gap: 0.5rem;
    z-index: 1000;
}

.btn-control {
    width: 44px;
    height: 44px;
    border: none;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    font-size: 1.1rem;
}

.btn-control:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* ========================================
   INFO CARD
   ======================================== */
/* Info Card - Old Modal Style (Keep for compatibility) */
.info-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background-color: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 3000;
    overflow: hidden;
    transition: all var(--transition-speed);
}

.info-card.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

/* Info Card - Top-Left Fixed Position (v2.7.0.2: More Compact) */
.info-card-fixed {
    position: fixed;
    top: calc(var(--header-height) + 10px);
    left: calc(var(--sidebar-width) + 1rem);
    width: 355px;
    /* Reduced from 320px */
    max-height: calc(100vh - var(--header-height) - 1rem - 13px);
    background-color: var(--bg-primary);
    border-radius: 10px;
    box-shadow: var(--shadow-xl);
    z-index: 2500;
    overflow: hidden;
    transition: all var(--transition-speed);
}

.sidebar-collapsed .info-card-fixed {
    left: 16px;
}

.info-card-fixed.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-30px);
}

/* v2.7.0: Dragging state */
.info-card-fixed.dragging {
    transition: none;
    /* Disable transitions while dragging */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.info-card-fixed.dragging .info-card-header {
    cursor: grabbing !important;
}

/* v2.7.0: Minimized state - only show header */
.info-card-fixed.minimized {
    max-height: 60px;
}

.info-card-fixed.minimized .info-card-body,
.info-card-fixed.minimized .info-card-actions-fixed {
    display: none;
}

.info-card-fixed.minimized #minimizeCard i {
    transform: rotate(180deg);
    /* Flip icon when minimized */
}

/* Adjust when sidebar is collapsed */

.info-card-header {
    padding: 0.75rem 1rem;
    /* v2.7.0.2: Further reduced */
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.info-card-header h2 {
    font-size: 1rem;
    /* v2.7.0.2: Reduced from 1.25rem */
    font-weight: 700;
    flex: 1;
    margin-right: 8px;
}

@media (max-width: 1023px) {
    .info-card-header h2 {
        font-size: 13px;
    }
}

/* v2.7.0: Card controls container */
.card-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-minimize i.pulse-icon {
    display: inline-block;
    /* cần để transform hoạt động */
    animation: pulseIcon 1.5s infinite ease-in-out;
    color: white;
}

@keyframes pulseIcon {
    0% {
        transform: scale(1);
        color: white;
    }

    50% {
        transform: scale(1.2);
        color: #fde68a;
    }

    /* phóng to */
    100% {
        transform: scale(1);
        color: white;
    }

    /* thu nhỏ về */
}

.btn-close,
.btn-minimize {
    width: 28px;
    /* v2.7.0.2: Reduced from 32px */
    height: 28px;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    font-size: 0.875rem;
    /* v2.7.0.2: Reduced from 1rem */
}

.btn-close:hover,
.btn-minimize:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.info-card-body {
    max-height: 100%;
    overflow-y: auto;
}

@media (max-width: 1023px) {
    .btn-close {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .btn-minimize {
        width: auto;
        height: 24px;
        padding-left: 6px;
        padding-right: 6px;
        background-color: var(--danger-color);
        font-size: 0.75rem;
    }

    .btn-minimize i {
        display: none !important;
    }
}

.info-section {
    margin-bottom: 1rem;
    /* v2.7.0.2: Reduced from 1.5rem */
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    font-size: 0.8rem;
    /* v2.7.0.2: Reduced from 1rem */
    font-weight: 600;
    margin-bottom: 0.65rem;
    /* v2.7.0.2: Reduced from 1rem */
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.info-section h3 i {
    color: var(--primary-color);
    font-size: 0.75rem;
    /* v2.7.0.2: Added smaller icon */
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    /* v2.7.0.2: Reduced from 1rem */
}

.info-label {
    font-size: 0.7rem;
    /* v2.7.0.2: Reduced from 0.8rem */
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 12px;
}

.info-value {
    font-size: 0.8rem;
    /* v2.7.0.2: Reduced from 0.95rem */
    color: var(--text-primary);
    font-weight: 600;
}

/* Tag List */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    /* v2.7.0.2: Reduced from 0.5rem */
}

.tag {
    padding: 0.3rem 0.6rem;
    /* v2.7.0.2: Reduced from 0.4rem 0.8rem */
    background-color: var(--bg-secondary);
    border-radius: 15px;
    font-size: 0.7rem;
    /* v2.7.0.2: Reduced from 0.85rem */
    font-weight: 500;
    color: var(--text-primary);
}

/* Connections List */
.connections-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* v2.7.0.2: Reduced from 0.75rem */
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    /* v2.7.0.2: Reduced from 1rem */
    padding: 0.6rem;
    /* v2.7.0.2: Reduced from 0.875rem */
    background-color: var(--metric-color);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    cursor: pointer;
}

.connection-item:hover {
    background-color: var(--bg-tertiary);
    transform: translateX(4px);
}

.connection-icon {
    width: 32px;
    /* v2.7.0.2: Reduced from 40px */
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.95rem;
    /* v2.7.0.2: Reduced from 1.2rem */
}

.connection-icon.airport {
    background-color: rgba(139, 92, 246, 0.15);
    color: var(--color-airport);
}

.connection-icon.seaport {
    background-color: rgba(6, 182, 212, 0.15);
    color: var(--color-seaport);
}

.connection-icon.admin {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--color-admin);
}

.connection-icon.hotel {
    background-color: rgba(236, 72, 153, 0.15);
    color: var(--color-hotel);
}

.connection-info {
    flex: 1;
}

.connection-name {
    font-size: 0.75rem;
    /* v2.7.0.2: Reduced from 0.95rem */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.connection-distance {
    font-size: 0.7rem;
}

.connection-distance i {
    margin-right: 0.25rem;
}

/* Info Actions */
.info-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-speed);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    transform: translateY(-2px);
}

/* ========================================
   CUSTOM LEAFLET STYLES
   ======================================== */
/* Modern Marker Styles */
.custom-icon-wrapper {
    background: transparent;
    border: none;
}

.modern-marker {
    width: 30.6px;
    height: 30.6px;
    border-radius: 50% 50% 50% 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15.3px;
    color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transform: rotate(-45deg);
    border: 3px solid white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-marker:hover {
    transform: rotate(-45deg) scale(1.15);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.modern-marker i {
    transform: rotate(45deg);
}

.industrial-marker {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.airport-marker {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.seaport-marker {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.admin-marker {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.hotel-marker {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.construction-marker {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.closed-marker {
    background: linear-gradient(135deg, #40403f, #363636);
}

.planning-marker {
    background: linear-gradient(135deg, #0e7618, #048906);
}

/* Distance Label Styles */
.distance-label-wrapper {
    background: transparent;
    border: none;
}

.distance-label {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    border: 2px solid white;
}

.leaflet-popup-content-wrapper {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-tip {
    background-color: var(--bg-primary);
}

.popup-content {
    padding: 0.5rem;
}

.popup-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.popup-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.popup-btn {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.popup-btn:hover {
    background-color: var(--primary-color);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .logo h1 {
        font-size: 1.2rem;
    }

}

@media (max-width: 1023px) {
    .logo h1 {
        display: none;
    }

    .info-card-fixed {
        top: calc(var(--header-height) + 10px + 40px + 10px);
        max-height: calc(100vh - var(--header-height) - 88px) !important;
    }

    .footer-compact .footer-content {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }

    .footer-logo {
        height: 22px;
    }

    .footer-copyright {
        margin-left: 0;
    }

    .map-type-label i {
        font-size: 1rem;
    }

    .info-card {
        width: 95%;
        max-height: 90vh;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-actions {
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    .info-card-fixed {
        left: 1rem !important;
        right: 1rem;
        width: calc(100% - 2rem);
    }
}

@media (max-width: 480px) {


    .footer-item:not(.footer-copyright) {
        flex: 0 0 calc(50% - 0.5rem);
    }
}

/* ========================================
   FOOTER - COMPACT VERSION
   ======================================== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    background-color: #eef6f9;
    z-index: 1;
    width: 360px;
    text-align: center;
}

.footer-compact .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 12px;
    color: #333;
}

.footer-logo {
    height: 28px;
    width: auto;
}

.footer-item i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

/* Adjust main container to account for compact footer */
.main-container {
    display: flex;
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height) - 45px);
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ========================================
   ADDITIONAL STYLES FOR V2.6
   ======================================== */

/* Language Selector */
.language-selector:hover {
    border-color: var(--primary-color);
}

.language-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 74, 143, 0.1);
}

/* Sidebar Header with Toggle */
.sidebar-header .sidebar-header .btn-icon:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.sidebar-header .btn-icon:hover i {
    color: white;
}

.sidebar-header .btn-icon i {
    font-size: 16px;
    /* Larger icon */
    color: var(--primary-color);
    transition: all 0.3s;
}

/* sidebar collapsed icon – handled by toggleSidebar() in app.js */
.sidebar.collapsed .btn-icon i {
    color: var(--primary-color);
}

@media (max-width: 767px) {
    #toggleBtnSidebarMobile {
        padding: 0.75rem 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0 1.25rem 1.25rem 0;
        border-color: transparent;
        position: fixed;
        z-index: 1;
        left: 360px;
        top: 80px;
        width: calc(100vw - 360px - 1rem);
        height: 2.5rem;
        transition: all 0.3s ease;
        opacity: 1;
        visibility: visible;
    }

    .sidebar-collapsed #toggleBtn {
        left: 0;
        opacity: 0;
        visibility: hidden;
    }
}

/* Sidebar Collapsed State – toggle handled by #toggleBtn (header) and #sidebarFloatBtn (floating) */
#sidebarFloatBtn {
    width: 110px;
    justify-content: center;
}

/* Mobile: when sidebar is open, prevent map from capturing taps */
@media (max-width: 1023px) {
    .sidebar:not(.collapsed) {
        box-shadow: var(--shadow-xl);
    }
}

@media (max-width: 767px) {
    .sidebar-button-close {
        background-color: #fff;
        color: var(--danger-color);
        border: 1px solid #e2e8f0;
        box-shadow: 2px 2px 2px rgba(0, 0, 0, .5);
        position: absolute;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        visibility: visible;
        left: 346px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .sidebar-collapsed .sidebar-button-close {
        opacity: 0;
        visibility: hidden;
        left: 0;
    }
}

/* Map Container Full Width when Sidebar Collapsed */
.main-container {
    display: flex;
    transition: all 0.3s ease;
}

/* Region Info Card */
.region-info-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
}

.btn-close-small {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close-small:hover {
    background: var(--bg-secondary);
    color: var(--danger-color);
}

/* Each row: icon | label | value (right aligned) */
.region-info-body

/* allow long labels to wrap, keep value right aligned */
.region-info-body .info-item span {
    white-space: normal;
    line-height: 1.2;
}

.region-info-body .info-item strong {
    justify-self: end;
    text-align: right;
    max-width: 52%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.region-info-body .info-item i {
    color: var(--primary-color);
    width: 22px;
    text-align: center;
}

.region-info-body .info-item span {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.region-info-body .info-item strong {
    justify-self: end;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
}

/* Contact Dropdown */
.contact-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.contact-button .fa-chevron-down {
    font-size: 12px;
    transition: transform 0.3s;
}

.contact-button.active .fa-chevron-down {
    transform: rotate(180deg);
}

.contact-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 5px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 10;
}

.contact-dropdown.hidden {
    display: none;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.contact-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

/* Info Actions with Dropdown */
.info-actions {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 1023px) {
    .region-info-body .contact-dropdown {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 320px;
    }
}

/* Info Card với Fixed Actions Bar */
.info-card-fixed {
    display: flex;
    flex-direction: column;
}

.info-card-body {
    flex: 1;
    overflow-y: auto;
    /* padding-bottom: 80px; */
    /* Space for fixed actions */
}

@media (max-width: 1023px) {
    .info-card-scroll {
        padding: 0;
    }
}

/* Fixed Actions Bar at Bottom */
.info-card-actions-fixed {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    z-index: 10;
    display: flex;
    gap: 10px;
}

.info-card-actions-fixed .btn {
    flex: 1;
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.75rem;
    text-transform: uppercase;
}

.info-card-actions-fixed .contact-button {
    position: relative;
}

/* Contact Dropdown positioning for fixed actions */
.info-card-actions-fixed .contact-dropdown {
    position: absolute;
    bottom: 100%;
    left: 1rem;
    right: 1rem;
    margin-bottom: 8px;
}

/* Ensure buttons are side by side */
.info-card-actions-fixed {
    flex-wrap: nowrap !important;
}

/* Mobile adjustments */
@media (max-width: 1023px) {
    .info-card-actions-fixed {
        padding: 0.75rem 1rem;
        gap: 8px;
    }

    .info-card-actions-fixed .btn {
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* === Tailwind Hybrid helpers (v2.6.6) === */

/* Sidebar collapsed helper (kept for map fullscreen) */
body.sidebar-collapsed .map-container {
    left: 0 !important;
    width: 100% !important;
    margin-left: 0 !important;
}

body.sidebar-collapsed #map {
    width: 100% !important;
}

/* Sidebar section collapse helpers */
.section-body {
    transition: all 0.2s ease;
}


/* Footer mobile optimization */
@media (max-width: 1023px) {
    .footer {
        right: 0;
        width: auto;
    }

    .footer-compact .footer-content {
        flex-direction: row;
        flex-wrap: wrap;
        /* v2.7.0.3: Allow wrapping if needed */
        gap: 0.75rem;
        /* v2.7.0.3: Increased from 0.5rem */
        justify-content: center;
        /* v2.7.0.3: Center items */
    }

    .footer-item {
        font-size: 12px;
        /* v2.7.0.3: Increased from 11px */
        padding: 0;
    }

    .footer-logo {
        height: 28px;
        /* v2.7.0.3: Increased from 24px */
        width: auto;
    }

    .footer-item i {
        font-size: 12px;
        /* v2.7.0.3: Increased from 11px */
    }
}

/* NOTE: #sidebarToggle removed; float button is #sidebarFloatBtn (see index.html inline CSS) */

/* ========================================
   v2.7.0: KCN Map Labels (Tooltips)
   ======================================== */
.kcn-label {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
    padding: 4px 6px !important;
    /* Reduced from 8px 12px */
    font-size: 9px !important;
    /* Reduced from 12px */
    line-height: 1.2 !important;
    /* Reduced from 1.4 */
    white-space: nowrap !important;
    pointer-events: none !important;
    z-index: 600 !important;
}

.kcn-label::before {
    border-right-color: rgba(255, 255, 255, 0.95) !important;
}

.kcn-label-content {
    text-align: left;
}

.kcn-label-content strong {
    font-size: 9px;
    /* Reduced from 13px */
    color: #1e293b;
    display: block;
    margin-bottom: 2px;
    /* Reduced from 4px */
    font-weight: 600;
}

.kcn-label .label-price,
.kcn-label .label-occupancy {
    font-size: 8px;
    /* Reduced from 11px */
    color: #64748b;
    display: block;
    line-height: 1.3;
}

.kcn-label .label-price {
    color: #059669;
    /* Green for price */
    font-weight: 500;
}

.kcn-label .label-occupancy {
    color: #2563eb;
    /* Blue for occupancy */
    font-weight: 500;
}

/* Hide labels at low zoom to reduce clutter */
@media (max-width: 1023px) {
    .kcn-label {
        font-size: 10px !important;
        padding: 6px 8px !important;
    }

    .kcn-label-content strong {
        font-size: 11px;
    }
}


/* ========================================
   v2.7.0.2: FIX Map Full Screen
   ======================================== */
/* Map container adjusts based on sidebar state */
.map-container {
    transition: left 0.3s ease-in-out;
}

/* When sidebar is collapsed, map goes full screen */
/* body.sidebar-collapsed .map-container {
    left: 0 !important;
} */
.map-container {
    left: 0 !important;
}

/* When sidebar is visible, map starts after sidebar */
/* body:not(.sidebar-collapsed) .map-container {
    left: 360px !important;
} */


/* v2.7.0.2: Description text styling */
.info-section p {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-secondary);
}


/* ── ISLAND MARKERS (Hoàng Sa / Trường Sa) ────────────────────────────────── */
.island-marker {
    background: linear-gradient(135deg, #0d9488, #0f766e);
}

.island-label {
    background-color: transparent !important;
    border-width: 0 !important;
    font-size: 12px !important;
    padding: 0 !important;
    font-weight: 700 !important;
    color: #ed3237 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    box-shadow: none !important;
    ;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.island-label::before {
    border-right-color: rgba(13, 148, 136, 0.92) !important;
}

/* Island marker pulse ring (sovereignty indicator) */
.island-marker-wrap {
    position: relative;
    width: 32px;
    height: 32px;
}

.island-marker-wrap::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50% 50% 50% 0;
    border: 2px solid rgba(13, 148, 136, 0.4);
    animation: island-pulse 2s ease-in-out infinite;
}

@keyframes island-pulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1) rotate(-45deg);
    }

    50% {
        opacity: 0.1;
        transform: scale(1.3) rotate(-45deg);
    }
}

.widget-contact {
    position: fixed;
    bottom: 2rem;
    left: calc(360px + 16px);
    z-index: 1;
}

.sidebar-collapsed .widget-contact {
    left: 16px;
}

@media (max-width: 1023px) {
    .widget-contact {
        left: 16px !important;
    }
}

.widget-contact-button {
    background-color: #f8e2e9;
    color: var(--danger-color);
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    padding: 0;
    transition: all .4s ease;
    padding-left: 1rem;
    padding-right: 1rem;
}

.widget-contact-button.active,
.widget-contact-button:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.widget-contact .contact-dropdown {
    min-width: 216px;
}

.widget-contact-button i {
    display: inline-block;
    animation: shakeZoom 1s infinite ease-in-out;
}

@media (max-width: 1023px) {
    .widget-contact {
        bottom: 28px;
    }
}

@keyframes shakeZoom {
    0% {
        transform: scale(1) rotate(0deg);
    }

    20% {
        transform: scale(1.1) rotate(-10deg);
    }

    40% {
        transform: scale(1.1) rotate(10deg);
    }

    60% {
        transform: scale(1.1) rotate(-8deg);
    }

    80% {
        transform: scale(1.1) rotate(8deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.leaflet-pane.leaflet-tooltip-pane .zone-label .zone-label-meta {
    padding-top: 4px;
}

.zone-label-occ i {
    color: #22c55e;
}

.zone-label-price i {
    color: #ed3237;
}

.zone-label-expiry-date i {
    color: #ec4899;
}

@media (max-width: 1023px) {
    .leaflet-pane.leaflet-tooltip-pane .zone-label {
        padding: 6px !important;
    }

    .leaflet-pane.leaflet-tooltip-pane .zone-label .zone-label-name {
        font-size: 12px;
    }

    .leaflet-pane.leaflet-tooltip-pane .zone-label .zone-label-meta {
        padding-top: 2px;
    }

    .leaflet-pane.leaflet-tooltip-pane .zone-label .zone-label-occ,
    .leaflet-pane.leaflet-tooltip-pane .zone-label .zone-label-price,
    .leaflet-pane.leaflet-tooltip-pane .zone-label .zone-label-expiry-date {
        font-size: 11px;
    }
}

/* CSS cho toast */
.toast-notification {
    top: auto !important;
    bottom: 20px !important;
    padding: 8px 16px !important;
    left: auto !important;
}

/* CSS cho search box trong header */
@media (max-width: 1023px) {
    .search-box-header {
        left: calc(1.5rem + 110px);
        top: 80px;
    }

    .search-box-header input {
        width: calc(100vw - 2.5rem - 110px);
        border: 1px solid #e2e8f0;
        box-shadow: 2px 2px 2px rgba(0, 0, 0, .5);
    }
}

.wechat-box {
    position: fixed;
    z-index: 2502;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100vw - 360px);
    height: calc(100vh - 70px);
    right: 0;
    bottom: 0;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
}

.wechat-box.show {
    opacity: 1;
    visibility: visible
}

.wechat-box img {
    max-width: 360px;
    max-height: 100%;
    border-radius: var(--border-radius);
}

.wechat-box-overlay {
    z-index: -1;
}

.sidebar-collapsed .wechat-box {
    width: 100%;
}

@media (max-width: 1023px) {
    .wechat-box {
        width: 100%;
    }
}

/* ========================================
   INDUSTRIAL INFO CARD – GALLERY REDESIGN
   ======================================== */
.card-hero-block {
    margin-bottom: 1rem;
}

.card-hero-media {
    position: relative;
    min-height: 190px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #eff6ff 55%, #f8fafc);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.card-hero-media img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.card-hero-empty {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-hero-empty i {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    color: #0f4c81;
    font-size: 1.1rem;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.card-hero-overlay {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    justify-content: flex-end;
}

.card-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background-color: var(--breadcrumb-bg-color);
    color: var(--primary-color);
    font-size: 0.7rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.card-gallery-thumbs {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.card-gallery-thumb {
    width: 68px;
    height: 54px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    background: #e2e8f0;
    cursor: pointer;
    flex: 0 0 auto;
    transition: all 0.2s ease;
}

.card-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-gallery-thumb.active {
    border-color: #0f4c81;
    box-shadow: 0 10px 20px rgba(15, 76, 129, 0.16);
}

.card-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.card-metric-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-body);
    font-weight: 700;
}

.card-metric-value {
    display: block;
    font-size: 1rem;
    line-height: 1.35;
    color: #0f172a;
}

.card-metric-value span {
    font-weight: normal;
    font-size: .6rem;
}

.card-metric-grid.card-metric-grid-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.card-metric-grid.card-metric-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-section {
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    padding: 0.95rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

.info-section h3 {
    font-size: 0.83rem;
    margin-bottom: 0.85rem;
}

@media (max-width: 1023px) {

    .card-hero-media,
    .card-hero-media img,
    .card-hero-empty {
        min-height: 170px;
        height: 170px;
    }
}


/* ========================================
   INDUSTRIAL INFO CARD – UI/UX REFINEMENT
   ======================================== */
.card-gallery-shell {
    display: none;
}

.card-gallery-shell:not(.hidden) {
    display: block;
}

.card-gallery-stage {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    background: linear-gradient(135deg, #dbeafe, #eff6ff 58%, #f8fafc);
}

.card-gallery-stage img {
    width: 100%;
    height: 220px;
    display: block;
    object-fit: cover;
}

.card-gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--breadcrumb-bg-color);
    color: var(--primary-color);
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    transition: all 0.2s ease;
    z-index: 2;
    font-size: 12px;
}

.card-gallery-btn:hover {
    background: rgba(186, 0, 0, 0.88);
    transform: translateY(-50%) scale(1.04);
}

.card-gallery-btn:disabled {
    opacity: 0.4;
    cursor: default;
    transform: translateY(-50%);
}

.card-gallery-btn.prev {
    left: 12px;
}

.card-gallery-btn.next {
    right: 12px;
}

.card-gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    z-index: 1;
    bottom: 12px;
    left: 12px;
}

.card-gallery-dots {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.card-gallery-dot {
    width: 1rem;
    height: 5px;
    border-radius: 5px;
    background-color: var(--breadcrumb-bg-color);
    cursor: pointer;
    transition: all 0.9s ease;
}

.card-gallery-dot.active {
    background-color: var(--primary-color);
}

.card-gallery-thumbs {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: thin;
}

.card-gallery-thumb {
    width: 74px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    background: #e2e8f0;
    cursor: pointer;
    flex: 0 0 auto;
    transition: all 0.2s ease;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.card-gallery-thumb:hover {
    transform: translateY(-1px);
}

.card-gallery-thumb.active {
    border-color: #0f4c81;
    box-shadow: 0 16px 24px rgba(15, 76, 129, 0.18);
}

.info-card-scroll {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.card-metric-grid {
    gap: 4px;
    margin-bottom: 0;
}

.card-metric-item {
    padding: 8px;
    border-radius: 8px;
    background-color: var(--metric-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.info-item {
    padding: 0.75rem 0.8rem;
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.82);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.info-label {
    display: block;
    margin-bottom: 0.32rem;
    font-size: 0.69rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #64748b;
}

.info-value {
    display: block;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #0f172a;
}

.info-grid-stack {
    grid-template-columns: 1fr;
}

.info-item-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9rem 0.95rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(226, 232, 240, 0.92);
}

.info-item-stack .info-label {
    margin-bottom: 0;
}

.info-item-stack .info-value {
    font-size: 0.84rem;
    line-height: 1.65;
    color: #1e293b;
}

.connections-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

@media (max-width: 1023px) {

    .card-gallery-stage,
    .card-gallery-stage img {
        min-height: 190px;
        height: 190px;
    }
}

/* Progress bar for card loading (optional) */
.card-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, .75);
    overflow: hidden;
    opacity: .8;
}

.card-progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    transition: width linear;
}