﻿body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden; /* Ẩn scrollbar để full màn hình */
}

/* CSS cho bản đồ full màn hình */
.mainlayout-content {
    height: 100vh; /* Thay đổi từ calc(100vh - 150px) sang 100vh */
    margin: 0;
    padding: 0;
}

.card-body {
    height: 100vh; /* Full viewport height */
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

#map {
    flex: 1;
    width: 100vw; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    min-height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Đảm bảo container không có padding/margin */
.container,
.container-fluid {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

.row {
    margin: 0 !important;
}

/* Sidebar với position fixed để hiển thị trên bản đồ full screen */
.sidebar {
    position: fixed; /* Thay đổi từ absolute sang fixed */
    top: 20px;
    left: 20px;
    width: 340px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 0;
    overflow: hidden;
    z-index: 10;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.sidebar-header {
    background: #f8fafc;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

    .sidebar-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #1e293b;
    }

.sidebar-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

    .sidebar-close:hover {
        background: #e2e8f0;
        color: #334155;
    }

.sidebar-content {
    padding: 24px;
}

.info-item {
    margin-bottom: 16px;
}

    .info-item:last-of-type {
        margin-bottom: 24px;
    }

.info-label {
    font-size: 13px;
    color: #1e0d0d;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.info-value {
    font-size: 14px;
    color: #334155;
    line-height: 1.5;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

    .btn-primary:hover {
        background: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }

.btn-success {
    background: #10b981;
    color: white;
}

    .btn-success:hover {
        background: #059669;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

.btn-outline {
    background: transparent;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
}

    .btn-outline:hover {
        background: #f8fafc;
        color: #334155;
        border-color: #cbd5e1;
    }

.btn-danger {
    background: #ef4444;
    color: white;
}

    .btn-danger:hover {
        background: #dc2626;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    }

/* Direction Panel với position fixed */
.direction-panel {
    position: fixed; /* Thay đổi từ absolute sang fixed */
    top: 20px;
    left: 20px;
    width: 380px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 20;
    display: none;
    flex-direction: column;
    padding: 0;
    font-size: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

    .direction-panel h3 {
        background: #f8fafc;
        padding: 20px 24px 16px;
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #1e293b;
        border-bottom: 1px solid #e2e8f0;
    }

.direction-content {
    padding: 24px;
}

    .direction-content p {
        margin: 0 0 16px 0;
        color: #64748b;
    }

    .direction-content input {
        padding: 12px 16px;
        width: 100%;
        border: 1.5px solid #e2e8f0;
        border-radius: 8px;
        font-size: 14px;
        box-sizing: border-box;
        transition: all 0.2s ease;
    }

        .direction-content input:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

.direction-results {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 8px;
}

    .direction-results div {
        padding: 12px 16px;
        cursor: pointer;
        border-bottom: 1px solid #f1f5f9;
        transition: background 0.2s ease;
    }

        .direction-results div:hover {
            background: #f8fafc;
        }

        .direction-results div:last-child {
            border-bottom: none;
        }

/* Route Info Panel với position fixed */
.route-info-panel {
    position: fixed; /* Thay đổi từ absolute sang fixed */
    bottom: 20px;
    left: 20px;
    width: 340px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 0;
    overflow: hidden;
    z-index: 15;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.08);
    max-height: 400px;
}

.route-info-header {
    background: #f8fafc;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .route-info-header h4 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #1e293b;
    }

.route-summary {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fefefe;
}

.route-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.route-stat {
    display: flex;
    flex-direction: column;
}

.route-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.route-stat-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.route-steps {
    max-height: 220px;
    overflow-y: auto;
    padding: 0;
}

.route-step {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

    .route-step:last-child {
        border-bottom: none;
    }

.step-number {
    background: #3b82f6;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-content {
    flex: 1;
}

.step-instruction {
    font-size: 14px;
    color: #334155;
    line-height: 1.4;
    margin-bottom: 4px;
}

.step-distance {
    font-size: 12px;
    color: #64748b;
}

.close-route-info {
    background: none;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

    .close-route-info:hover {
        background: #e2e8f0;
        color: #334155;
    }

/* Custom Marker Styles */
.custom-marker {
    width: 30px;
    height: 40px;
    position: relative;
    cursor: pointer;
}

    .custom-marker::before {
        content: '';
        position: absolute;
        width: 30px;
        height: 30px;
        border-radius: 50% 50% 50% 0;
        transform: rotate(-45deg);
        left: 0;
        top: 0;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    .custom-marker::after {
        content: '';
        position: absolute;
        width: 12px;
        height: 12px;
        background: white;
        border-radius: 50%;
        left: 9px;
        top: 9px;
        transform: rotate(45deg);
    }

.marker-start::before {
    background: #ef4444;
}

.marker-end::before {
    background: #10b981;
}

/* School Selector Styles với position fixed */
.school-selector-container {
    position: fixed; /* Thay đổi từ absolute sang fixed */
    top: 20px;
    right: 20px;
    z-index: 100;
    width: 320px;
}

.school-selector-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    transition: all 0.3s ease;
}

    .school-selector-wrapper:hover {
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }

.selector-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

    .selector-label::before {
        content: "🏫";
        font-size: 18px;
    }

.school-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

    .school-select:hover {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .school-select:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    }

    .school-select option {
        padding: 12px;
        background: white;
        color: #334155;
    }

/* Custom dropdown for better styling (if using select2) */
.select2-container--default .select2-selection--single {
    background: white !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    height: 48px !important;
    padding: 0 16px !important;
    transition: all 0.3s ease !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #334155 !important;
    line-height: 44px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px !important;
    right: 12px !important;
}

.select2-dropdown {
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    margin-top: 4px !important;
}

.select2-results__option {
    padding: 12px 16px !important;
    font-size: 14px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

    .select2-results__option:hover {
        background: #f8fafc !important;
        color: #1e293b !important;
    }

.select2-results__option--highlighted {
    background: #3b82f6 !important;
    color: white !important;
}

.select2-results__option:last-child {
    border-bottom: none !important;
}

/* Status indicator */
.selector-status {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 12px;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .selector-status::before {
        content: "ℹ️";
        font-size: 14px;
    }


/* CSS cho popup thông tin thuộc tính */
.mapboxgl-popup-content,
.vietmapgl-popup-content {
    padding: 16px 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    min-width: 260px !important;
    max-width: 320px !important;
}

/* Header của popup */
.popup-header {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

/* Nội dung thông tin */
.popup-info {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

    .popup-info div {
        margin-bottom: 8px;
    }

    .popup-info b {
        color: #333;
        font-weight: 600;
        display: inline-block;
        min-width: 80px;
    }

/* Style cho dấu X đóng popup */
.mapboxgl-popup-close-button,
.vietmapgl-popup-close-button {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 24px !important;
    height: 24px !important;
    background: #f3f4f6 !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    font-weight: bold !important;
    color: #6b7280 !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
}

    .mapboxgl-popup-close-button:hover,
    .vietmapgl-popup-close-button:hover {
        background: #e5e7eb !important;
        color: #374151 !important;
        transform: scale(1.1) !important;
    }

/* Mũi tên của popup */
.mapboxgl-popup-tip,
.vietmapgl-popup-tip {
    border-top-color: white !important;
    border-bottom-color: white !important;
}

/* Responsive cho màn hình nhỏ */
@media (max-width: 768px) {
    .mapboxgl-popup-content,
    .vietmapgl-popup-content {
        padding: 12px 16px !important;
        min-width: 240px !important;
        max-width: 280px !important;
    }

    .popup-header {
        font-size: 15px;
    }

    .popup-info {
        font-size: 13px;
    }
}

.map-type-controls {
    position: absolute;
    bottom: 80px;
    left: 10px;
    z-index: 1000;
    display: flex;
    gap: 5px;
    background: white;
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Responsive: Trên mobile, đặt filter ở trên cùng */
@media (max-width: 768px) {
    .filter-container {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }

        .filter-container.moved {
            left: 10px;
            top: 10px;
        }
}

.map-type-btn {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    transition: all 0.3s;
}

    .map-type-btn:hover {
        background: #f5f5f5;
    }

    .map-type-btn.active {
        background: #0078ff;
        color: white;
        border-color: #0078ff;
    }

    .map-type-btn i {
        margin-right: 5px;
    }