/* =============================================================================
 * T-AIMS DIGITAL TWIN 3D ARCHITECTURAL STYLES
 * ============================================================================= */

/* 2D CAD vs 3D Digital Twin Dimension Switcher Pill */
.dimension-switcher {
    display: inline-flex;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 20px;
    padding: 3px 5px;
    gap: 4px;
    margin-left: 0;
    align-items: center;
    vertical-align: middle;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    width: fit-content;
    flex-shrink: 0;
}
.btn-dim {
    border-radius: 16px;
    padding: 5px 14px;
    font-size: 0.74rem;
    border: none;
    background: transparent;
    color: #94A3B8;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-dim:hover {
    color: #FFF;
    background: rgba(255, 23, 68, 0.15);
}
.btn-dim.active {
    background: rgba(255, 23, 68, 0.22) !important;
    border: 1.5px solid #FF1744 !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    box-shadow: 0 0 14px rgba(255, 23, 68, 0.45) !important;
}
.btn-dim.active i {
    color: #FFFFFF !important;
}

/* Container Stage 3D */
.fp3d-master-stage {
    position: relative;
    width: 100%;
    background: #070B14;
    border: 1.5px solid rgba(225, 29, 72, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 16px rgba(225, 29, 72, 0.12);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}
.fp3d-floating-toolbar {
    position: absolute;
    top: 14px;
    right: 14px;
    left: auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
}
.fp3d-toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(10, 15, 29, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 5px 8px;
    pointer-events: auto;
}
.btn-fp3d-view,
.btn-fp3d-site,
.btn-fp3d-action {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-fp3d-view:hover,
.btn-fp3d-site:hover,
.btn-fp3d-action:hover {
    color: #FFF;
    background: rgba(56, 189, 248, 0.15);
}
.btn-fp3d-view.active,
.btn-fp3d-site.active {
    background: rgba(6, 182, 212, 0.25);
    color: var(--cyan-neon);
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}
.btn-fp3d-action.active-xray {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.5);
}
.btn-fp3d-action.night-on {
    background: rgba(139, 92, 246, 0.2);
    color: #A78BFA;
    border-color: rgba(139, 92, 246, 0.5);
}
.btn-fp3d-action.rotate-on {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
    border-color: rgba(16, 185, 129, 0.5);
}

/* Canvas Area */
#fp3d-canvas-stage {
    width: 100%;
    height: 560px;
    display: block;
    cursor: grab;
}
#fp3d-canvas-stage:active {
    cursor: grabbing;
}

/* CCTV HUD */
.fp3d-cctv-hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
    z-index: 5;
    border: 2px solid rgba(245, 158, 11, 0.3);
    background: radial-gradient(circle, transparent 65%, rgba(0, 0, 0, 0.6) 100%);
}
.fp3d-cctv-hud.active {
    display: block;
}
.cctv-rec-badge {
    position: absolute;
    top: 60px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #EF4444;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
}
.cctv-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #EF4444;
    animation: pulseRed 1s infinite;
}
.cctv-cam-title {
    position: absolute;
    top: 60px;
    right: 20px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #F59E0B;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 4px;
}
.cctv-timestamp {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.75);
    color: #F8FAFC;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 4px;
}
.cctv-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 50%;
}
.cctv-crosshair::before,
.cctv-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(245, 158, 11, 0.4);
}
.cctv-crosshair::before { top: 50%; left: -8px; right: -8px; height: 1px; }
.cctv-crosshair::after { left: 50%; top: -8px; bottom: -8px; width: 1px; }

/* Tooltip Hover Pin */
.fp3d-tooltip {
    position: absolute;
    display: none;
    z-index: 20;
    pointer-events: none;
    background: rgba(13, 16, 23, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(225, 29, 72, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    min-width: 200px;
}
.fp3d-tooltip-title {
    font-weight: 700;
    color: #FFF;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.fp3d-tooltip-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.fp3d-tooltip-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.fp3d-tooltip-badge.online { background: rgba(16, 185, 129, 0.2); color: #10B981; }
.fp3d-tooltip-badge.offline { background: rgba(239, 68, 68, 0.2); color: #EF4444; }

/* Accordion Perangkat */
.fp3d-device-accordion {
    background: #0B0E14;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.fp3d-acc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    gap: 8px;
}
.fp3d-acc-header:hover {
    background: rgba(255, 255, 255, 0.03);
}
.fp3d-acc-header-left {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1 1 auto;
    min-width: 0;
}
.fp3d-acc-title {
    color: #FFF;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
#fp3d-site-badge {
    white-space: nowrap;
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 9999px;
    background: rgba(225, 29, 72, 0.12);
    color: #FDA4AF;
    border: 1px solid rgba(225, 29, 72, 0.35);
    flex-shrink: 0;
}
.fp3d-acc-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.btn-fp3d-add-pin {
    background: rgba(16, 185, 129, 0.22) !important;
    border: 1.2px solid #10B981 !important;
    color: #6EE7B7 !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    line-height: 1.2 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.22) !important;
    transition: all 0.2s ease !important;
}
.btn-fp3d-add-pin:hover {
    background: rgba(16, 185, 129, 0.35) !important;
    color: #FFFFFF !important;
    border-color: #34D399 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45) !important;
    transform: translateY(-1px) !important;
}
@media (max-width: 580px) {
    .fp3d-acc-header {
        padding: 9px 12px;
        gap: 8px;
    }
    .fp3d-acc-title {
        font-size: 0.82rem;
    }
    #fp3d-site-badge {
        display: none !important; /* Diringkas di layar HP agar tombol Titik Baru leluasa dan rapi */
    }
    .btn-fp3d-add-pin {
        font-size: 0.74rem !important;
        padding: 5px 10px !important;
    }
}
.fp3d-device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    padding: 14px 18px 18px 18px;
    background: #080A0F;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.fp3d-device-card {
    background: linear-gradient(180deg, #141722 0%, #0B0D13 100%) !important;
    border: 1.5px solid #E11D48 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 14px rgba(225, 29, 72, 0.32) !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}
.fp3d-device-card:hover {
    border-color: #FF1744 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), 0 0 18px rgba(255, 23, 68, 0.5) !important;
    transform: translateY(-2px) !important;
}
.fp3d-dev-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.fp3d-dev-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fp3d-dev-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(225, 29, 72, 0.12);
    border: 1px solid rgba(225, 29, 72, 0.35);
    color: #FDA4AF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.fp3d-dev-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #F8FAFC;
}
.fp3d-dev-loc {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.fp3d-dev-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    gap: 8px;
}
.fp3d-dev-ip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #94A3B8;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fp3d-dev-ip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #94A3B8;
}
.btn-fp3d-focus {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #E2E8F0;
    font-size: 0.70rem;
    font-weight: 600;
    height: 28px !important;
    padding: 0 9px !important;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    transition: all 0.2s;
}
.btn-fp3d-focus:hover {
    background: rgba(225, 29, 72, 0.22);
    border-color: rgba(225, 29, 72, 0.55);
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.25);
}

/* Compare Modal */
.compare-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.compare-col {
    background: #0E121C;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
}
.compare-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cyan-neon);
    margin-bottom: 8px;
}
.compare-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
@media (max-width: 768px) {
    .compare-grid { grid-template-columns: 1fr; }
    #fp3d-canvas-stage { height: 420px; }
    .fp3d-floating-toolbar {
        top: 8px;
        right: 6px;
        left: 6px;
        justify-content: center;
        overflow-x: hidden;
        flex-wrap: nowrap;
        padding-bottom: 0;
        pointer-events: auto;
    }
    .fp3d-toolbar-group {
        display: flex;
        align-items: center;
        gap: 3px;
        padding: 4px 6px;
        width: 100%;
        max-width: 400px;
        justify-content: space-between;
    }
    .btn-fp3d-view,
    .btn-fp3d-site,
    .btn-fp3d-action {
        padding: 4px 5px;
        font-size: 0.68rem;
        gap: 3px;
        white-space: nowrap;
        flex: 1 1 auto;
        justify-content: center;
    }
}
@media (hover: none) {
    .fp3d-tooltip {
        display: none !important;
    }
}