.campus-explorer-header { text-align: center; margin-bottom: var(--section-title-space); }

.campus-layout {
    display: flex;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.03), 0 12px 40px rgba(0,0,0,0.06);
    border: 1px solid var(--th-border-color);
    background: var(--white-color);
    height: 620px;
}
@media (max-width: 991px) { .campus-layout { flex-direction: column; height: auto; } }

.campus-panel {
    width: 280px; min-width: 280px;
    display: flex; flex-direction: column;
    background: var(--smoke-color2);
    border-right: 1px solid var(--th-border-color);
}
@media (max-width: 1199px) { .campus-panel { width: 250px; min-width: 250px; } }
@media (max-width: 991px) {
    .campus-panel { width: 100%; min-width: 100%; border-right: none; border-top: 1px solid var(--th-border-color); order: 2; }
}

.panel-header { padding: 20px 20px 0; }
.panel-header h3 {
    font-family: var(--title-font); font-size: 13px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase; color: var(--theme-color); margin: 0 0 4px;
}
.panel-header p { font-size: 13px; color: var(--light-color); margin: 0; }

.building-list {
    flex: 1; overflow-y: auto; padding: 14px 10px;
    scrollbar-width: thin; scrollbar-color: #1b2357 transparent;
}
.building-list::-webkit-scrollbar { width: 4px; }
.building-list::-webkit-scrollbar-thumb { background: var(--gray-color); border-radius: 4px; }
@media (max-width: 991px) {
    .building-list {
        display: flex; overflow-x: auto; overflow-y: hidden;
        padding: 12px; gap: 8px;
        scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    }
}

.building-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px; border-radius: 12px;
    cursor: pointer; transition: all 0.3s ease;
    margin-bottom: 2px; border: 2px solid transparent;
}
.building-item:hover { background: rgba(16,107,159,0.05); }
.building-item.active {
    background: var(--white-color); border-color: var(--theme-color);
    box-shadow: 0 2px 12px rgba(16,107,159,0.08);
}
@media (max-width: 991px) {
    .building-item {
        min-width: 140px; flex-direction: column; align-items: center;
        text-align: center; gap: 8px; scroll-snap-align: start;
        margin-bottom: 0; padding: 10px 12px;
    }
}

.building-num {
    width: 34px; height: 34px; min-width: 34px; border-radius: 50%;
    background: var(--theme-color); color: var(--white-color);
    font-family: var(--title-font); font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
}
.building-item.active .building-num { background: var(--title-color); box-shadow: 0 2px 8px rgba(27,34,90,0.2); }
.building-item.faculty .building-num { background: #b79a53; }
.building-item.faculty.active .building-num { background: #967a3a; }

.building-info h4 {
    font-family: var(--title-font); font-size: 14px; font-weight: 600;
    color: var(--title-color); margin: 0 0 2px; line-height: 1.3;
}
.building-info p { font-size: 12px; color: var(--body-color); margin: 0; line-height: 1.4; }
@media (max-width: 991px) {
    .building-info h4 { font-size: 13px; }
    .building-info p { display: none; }
}

.campus-map-side { flex: 1; position: relative; z-index: 0; }
@media (max-width: 991px) { .campus-map-side { min-height: 400px; order: 1; } }
@media (max-width: 575px) { .campus-map-side { min-height: 320px; } }

#campusMap { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 0; }
.leaflet-container { background: #dce8f0; font-family: var(--body-font); }
.leaflet-pane { z-index: 1 !important; }
.leaflet-map-pane { z-index: 1 !important; }
.leaflet-overlay-pane { z-index: 2 !important; }
.leaflet-marker-pane { z-index: 3 !important; }
.leaflet-tooltip-pane { z-index: 4 !important; }
.leaflet-popup-pane { z-index: 5 !important; }

.building-detail {
    width: 0; min-width: 0; overflow: hidden;
    background: var(--white-color); border-left: 0px solid var(--th-border-color);
    display: flex; flex-direction: column;
    transition: width 0.4s cubic-bezier(0.4,0,0.2,1), min-width 0.4s cubic-bezier(0.4,0,0.2,1), border-width 0.4s ease;
}
.building-detail.open { width: 340px; min-width: 340px; border-left-width: 1px; }
@media (max-width: 1199px) { .building-detail.open { width: 290px; min-width: 290px; } }

.building-detail-inner {
    padding: 22px; flex: 1; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #1b2357 transparent;
}
.building-detail-inner::-webkit-scrollbar { width: 4px; }
.building-detail-inner::-webkit-scrollbar-thumb { background: var(--gray-color); border-radius: 4px; }

.detail-img { width: 100%; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.detail-img img { width: 100%; height: 170px; object-fit: cover; display: block; }
.detail-title {
    font-family: var(--title-font); font-size: 18px; font-weight: 700;
    color: var(--title-color); margin: 0 0 4px;
}
.detail-subtitle {
    font-size: 11px; color: var(--theme-color); font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px; margin: 0 0 14px;
}
.detail-depts { font-size: 13px; line-height: 1.7; color: var(--body-color); }
.dept-group { padding: 5px 0; border-bottom: 1px solid var(--smoke-color); }
.dept-group:last-child { border-bottom: none; }

.detail-close {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; width: 100%; padding: 11px;
    border: none; background: var(--smoke-color2); color: var(--body-color);
    font-family: var(--title-font); font-size: 12px; font-weight: 600;
    cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.detail-close:hover { background: var(--smoke-color); }
.detail-handle { display: none; }

@media (max-width: 991px) {
    .building-detail {
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 42;
        width: 100% !important; min-width: 100% !important;
        border-left: none !important;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
        max-height: 0;
        transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
    }
    .building-detail.open { max-height: 70vh; }
    .building-detail-inner { padding: 6px 20px 20px; }
    .detail-handle {
        display: block; width: 40px; height: 4px; border-radius: 2px;
        background: var(--gray-color); margin: 10px auto 10px;
    }
}

.campus-marker {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--theme-color); color: var(--white-color);
    font-family: var(--title-font); font-weight: 700; font-size: 13px;
    border: 3px solid var(--white-color);
    box-shadow: 0 3px 12px rgba(16,107,159,0.40), 0 0 0 2px rgba(16,107,159,0.10);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
    position: relative;
}
.campus-marker::after {
    content: ''; position: absolute; width: 100%; height: 100%;
    border-radius: 50%; border: 2px solid rgba(16,107,159,0.25);
    animation: markerPulse 2.5s ease-out infinite; pointer-events: none;
}
.campus-marker:hover, .campus-marker.active {
    transform: scale(1.25);
    box-shadow: 0 5px 20px rgba(16,107,159,0.50), 0 0 0 4px rgba(16,107,159,0.15);
}
.campus-marker.active { background: var(--title-color); }
.campus-marker.marker-faculty {
    background: #b79a53;
    box-shadow: 0 3px 12px rgba(183,154,83,0.40), 0 0 0 2px rgba(183,154,83,0.10);
}
.campus-marker.marker-faculty::after { border-color: rgba(183,154,83,0.25); }
.campus-marker.marker-faculty:hover, .campus-marker.marker-faculty.active {
    background: #967a3a;
    box-shadow: 0 5px 20px rgba(183,154,83,0.50), 0 0 0 4px rgba(183,154,83,0.15);
}
@keyframes markerPulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
}

.map-style-toggle {
    position: absolute; bottom: 14px; left: 14px; z-index: 10;
    display: flex; gap: 3px;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(6px);
    border-radius: 8px; padding: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.map-style-toggle button {
    font-family: var(--title-font); font-weight: 600; font-size: 12px;
    padding: 6px 12px; border: none; border-radius: 6px;
    background: transparent; color: var(--body-color);
    cursor: pointer; transition: all 0.25s ease;
}
.map-style-toggle button.active { background: var(--theme-color); color: var(--white-color); }
.map-style-toggle button i { margin-right: 4px; }

.map-nav-link {
    position: absolute; top: 14px; right: 14px; z-index: 10;
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(6px);
    border-radius: 8px; padding: 7px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    font-family: var(--title-font); font-size: 12px; font-weight: 600;
    color: var(--title-color); text-decoration: none; transition: all 0.25s ease;
}
.map-nav-link:hover { background: var(--white-color); color: var(--theme-color); }

@media (max-width: 991px) {
    .map-nav-link { top: auto; bottom: 14px; right: 14px; padding: 7px 10px; }
    .nav-label { display: none; }
    .toggle-label { display: none; }
    .map-style-toggle button { padding: 7px 10px; }
    .map-style-toggle button i { margin-right: 0; }
}

.leaflet-top, .leaflet-bottom { z-index: 8 !important; }
.leaflet-control-attribution { font-size: 10px !important; background: rgba(255,255,255,0.65) !important; }
.leaflet-control-zoom {
    border: none !important; box-shadow: 0 2px 8px rgba(0,0,0,0.10) !important;
    border-radius: 8px !important; overflow: hidden;
}
.leaflet-control-zoom a {
    width: 32px !important; height: 32px !important; line-height: 32px !important;
    font-size: 15px !important; color: var(--title-color) !important;
    border-bottom: 1px solid #eee !important;
}
.leaflet-control-zoom a:last-child { border-bottom: none !important; }
