/* ==========================================================================
   SBTU WebGL 3D Interactive Map (MapLibre GL JS + Floating Glass Card)
   ========================================================================== */

.sbtu-map3d-section {
    position: relative;
    width: 100%;
    height: 460px;
    background: #061224;
    overflow: hidden;
    border-top: 2px solid rgba(0, 159, 227, 0.55);
    isolation: isolate;
}

.sbtu-map3d-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Soft top & bottom edge blending with adjacent dark Stage3D sections */
.sbtu-map3d-section::before,
.sbtu-map3d-section::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 2;
}

.sbtu-map3d-section::before {
    top: 0;
    height: 44px;
    background: linear-gradient(180deg, rgba(5, 14, 29, 0.52) 0%, transparent 100%);
}

.sbtu-map3d-section::after {
    bottom: 0;
    height: 54px;
    background: linear-gradient(0deg, rgba(5, 13, 26, 0.62) 0%, transparent 100%);
}

/* Floating Glass Campus Info Card */
.sbtu-map3d-card {
    position: absolute;
    top: 22px;
    left: 22px;
    z-index: 4;
    width: min(320px, calc(100% - 44px));
    padding: 18px 18px 16px;
    border-radius: 16px;
    background: linear-gradient(
        155deg,
        rgba(6, 18, 36, 0.86) 0%,
        rgba(10, 27, 52, 0.78) 100%
    );
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow:
        0 18px 40px -12px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #ffffff;
}

.sbtu-map3d-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 159, 227, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.38);
    color: #7dd3fc;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.sbtu-map3d-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00c6ff;
    box-shadow: 0 0 8px #00c6ff;
}

.sbtu-map3d-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
}

.sbtu-map3d-address {
    margin: 0 0 14px;
    font-size: 12.5px;
    line-height: 1.45;
    color: rgba(203, 213, 225, 0.88);
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.sbtu-map3d-address i {
    color: #38bdf8;
    margin-top: 3px;
    flex-shrink: 0;
}

.sbtu-map3d-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sbtu-map3d-btn {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.sbtu-map3d-btn--primary {
    background: linear-gradient(135deg, #009fe3 0%, #0284c7 100%);
    color: #ffffff !important;
    border: 1px solid rgba(56, 189, 248, 0.5);
    box-shadow: 0 6px 16px -4px rgba(0, 159, 227, 0.55);
}

.sbtu-map3d-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -4px rgba(0, 198, 255, 0.7);
}

.sbtu-map3d-btn--ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.sbtu-map3d-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(56, 189, 248, 0.55);
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* Floating 3D Camera Controls (Top Right) */
.sbtu-map3d-toolbar {
    position: absolute;
    top: 22px;
    right: 60px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border-radius: 12px;
    background: rgba(6, 18, 36, 0.82);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sbtu-map3d-tool {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.sbtu-map3d-tool:hover,
.sbtu-map3d-tool.is-active {
    background: rgba(0, 159, 227, 0.26);
    color: #ffffff;
}

.sbtu-map3d-tool.is-active {
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.5);
}

/* Custom Glowing 3D Marker */
.sbtu-map3d-pin {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sbtu-map3d-pin-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 159, 227, 0.32);
    border: 2px solid rgba(56, 189, 248, 0.85);
    animation: sbtuMapPinPulse 2.4s ease-out infinite;
}

.sbtu-map3d-pin-core {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(145deg, #00c6ff 0%, #0077b6 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 6px 18px rgba(0, 159, 227, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
}

@keyframes sbtuMapPinPulse {
    0% {
        transform: scale(0.75);
        opacity: 0.95;
    }
    100% {
        transform: scale(2.1);
        opacity: 0;
    }
}

/* MapLibre Popup Override */
.sbtu-map3d-section .maplibregl-popup-content {
    background: rgba(6, 18, 36, 0.92);
    color: #ffffff;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12.5px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

.sbtu-map3d-section .maplibregl-popup-tip {
    border-top-color: rgba(6, 18, 36, 0.92) !important;
}

.sbtu-map3d-section .maplibregl-ctrl-group {
    background: rgba(6, 18, 36, 0.84) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5) !important;
}

.sbtu-map3d-section .maplibregl-ctrl-group button {
    filter: invert(1) brightness(1.1);
}

/* Fallback Iframe */
.sbtu-map3d-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: none;
    z-index: 1;
}

.sbtu-map3d-section.is-fallback .sbtu-map3d-fallback {
    display: block;
}

.sbtu-map3d-section.is-fallback .sbtu-map3d-toolbar {
    display: none;
}

/* Bottom Center Floating Glass Medallion Seam */
.sbtu-map3d-seam {
    position: relative;
    width: 100%;
    height: 0;
    z-index: 8;
}

.sbtu-map3d-seam-logo {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(16, 42, 78, 0.96) 0%, rgba(5, 13, 26, 0.98) 100%);
    border: 2px solid rgba(56, 189, 248, 0.65);
    box-shadow:
        0 10px 28px -4px rgba(0, 0, 0, 0.72),
        0 0 22px rgba(0, 159, 227, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
    cursor: pointer;
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.sbtu-map3d-seam-logo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/app/themes/html/assets/images/klogo-clean.png') no-repeat center / 42px auto;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.sbtu-map3d-seam-logo:hover {
    border-color: #38bdf8;
    box-shadow:
        0 14px 34px -4px rgba(0, 0, 0, 0.8),
        0 0 32px rgba(0, 198, 255, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sbtu-map3d-seam-logo:hover::after {
    transform: perspective(360px) rotateY(360deg) scale(1.08);
}

@media (max-width: 768px) {
    .sbtu-map3d-seam-logo {
        width: 52px;
        height: 52px;
    }
    .sbtu-map3d-seam-logo::after {
        background-size: 32px auto;
    }
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .sbtu-map3d-section {
        height: 430px;
    }

    .sbtu-map3d-card {
        top: auto;
        bottom: 14px;
        left: 12px;
        right: 12px;
        width: auto;
        padding: 13px 14px;
        border-radius: 14px;
    }

    .sbtu-map3d-badge {
        margin-bottom: 6px;
        font-size: 10px;
    }

    .sbtu-map3d-title {
        font-size: 14px;
    }

    .sbtu-map3d-address {
        font-size: 11.5px;
        margin-bottom: 10px;
    }

    .sbtu-map3d-toolbar {
        top: 12px;
        left: 12px;
        right: auto;
        padding: 4px;
    }

    .sbtu-map3d-tool {
        padding: 5px 8px;
        font-size: 11px;
    }
}
