/* ==========================================================================
   BERLEEN STORE - VIRTUAL REALITY (VR) CORPORATE HQ
   Bright Modern Corporate Architecture • Nature Landscape Views
   Realistic Walking • Glass Partition Rooms • Instant In-Place Window View
   ========================================================================== */

/* 1. Floating Action Button (FAB) on Left Side - Directly Above Gaming Mode Button */
#berlin-vr-fab {
    position: fixed;
    left: 20px;
    bottom: 236px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    border: 2px solid rgba(255, 255, 255, 0.65);
    color: #ffffff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    isolation: isolate;
}

#berlin-vr-fab:hover {
    transform: scale(1.08) translateY(-2px);
    background: linear-gradient(135deg, #0369a1, #0ea5e9);
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.8);
    border-color: #ffffff;
}

#berlin-vr-fab i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
    transition: transform 0.25s ease;
}

#berlin-vr-fab:hover i {
    transform: scale(1.1);
}

/* Tooltip on Hover */
#berlin-vr-fab::after {
    content: "مقر الشركة الافتراضي VR";
    position: absolute;
    left: 74px;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

#berlin-vr-fab:hover::after,
#berlin-vr-fab:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Sidebar button also available on desktop */
.berlin-vr-launch-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin: 8px 0 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(56, 189, 248, 0.18));
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 12px;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.22);
    transition: all 0.25s ease;
}

.berlin-vr-launch-btn:hover {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.45), rgba(56, 189, 248, 0.35));
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(56, 189, 248, 0.4);
}

.berlin-vr-badge-tag {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.5px;
}

/* Hide VR FAB and launch button on Mobile & Tablets */
@media (max-width: 1024px), (pointer: coarse) {
    #berlin-vr-fab,
    .berlin-vr-launch-btn {
        display: none !important;
    }
}

/* 2. Fullscreen VR Overlay Container */
#berlin-vr-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483640;
    background: #e2e8f0;
    font-family: inherit;
    user-select: none;
    overflow: hidden;
    display: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

#berlin-vr-overlay.active {
    display: block;
    opacity: 1;
}

#berlin-vr-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* 3. Bright Modern Corporate HUD Glass Layer */
.berlin-vr-hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 20px;
    box-sizing: border-box;
    z-index: 5;
}

/* 4. Top Navigation Bar */
.berlin-vr-topbar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    pointer-events: auto;
}

.berlin-vr-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(2, 132, 199, 0.25);
    padding: 8px 18px;
    border-radius: 999px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.berlin-vr-branding img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(2, 132, 199, 0.3);
}

.berlin-vr-title-group h2 {
    margin: 0;
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.berlin-vr-title-group span {
    font-size: 0.72rem;
    color: #0284c7;
    font-weight: 700;
}

.berlin-vr-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    display: inline-block;
    animation: berlinVrBlink 1.8s infinite;
}

@keyframes berlinVrBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.berlin-vr-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.berlin-vr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-radius: 999px;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.berlin-vr-btn:hover {
    background: #ffffff;
    border-color: #0284c7;
    color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2);
}

.berlin-vr-exit-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
    color: #ffffff;
}

.berlin-vr-exit-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

/* 5. Center Crosshair & Interaction Prompt */
.berlin-vr-crosshair-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.berlin-vr-crosshair {
    width: 22px;
    height: 22px;
    position: relative;
}

.berlin-vr-crosshair::before,
.berlin-vr-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(2, 132, 199, 0.85);
    box-shadow: 0 0 6px rgba(2, 132, 199, 0.6);
}

.berlin-vr-crosshair::before {
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
}

.berlin-vr-crosshair::after {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
}

.berlin-vr-crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #0284c7;
    border-radius: 50%;
}

/* Dynamic Interaction Prompt */
.berlin-vr-prompt {
    display: none;
    align-items: center;
    gap: 9px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    border: 1px solid #ffffff;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 0 6px 22px rgba(2, 132, 199, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    animation: berlinPromptPulse 1.2s ease-in-out infinite alternate;
    white-space: nowrap;
}

.berlin-vr-prompt.active {
    display: inline-flex;
}

.berlin-vr-prompt.has-alert {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: #fef08a !important;
    color: #ffffff !important;
    box-shadow: 0 6px 26px rgba(239, 68, 68, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    animation: berlinPromptAlertPulse 1.0s ease-in-out infinite alternate !important;
}

@keyframes berlinPromptAlertPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6)); }
    100% { transform: scale(1.05); filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.9)); }
}

@keyframes berlinPromptPulse {
    0% { transform: scale(0.97); }
    100% { transform: scale(1.03); box-shadow: 0 8px 28px rgba(14, 165, 233, 0.7); }
}

.berlin-vr-prompt-key {
    background: #ffffff;
    color: #0369a1;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 0.82rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* 6. Minimap Radar (Top-Right) */
.berlin-vr-minimap-container {
    position: absolute;
    top: 70px;
    right: 20px;
    z-index: 10;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(2, 132, 199, 0.25);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.berlin-vr-minimap-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #475569;
    letter-spacing: 0.5px;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 4px;
}

#berlin-vr-minimap {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 249, 255, 0.9) 0%, rgba(224, 242, 254, 0.85) 75%);
    border: 1px solid rgba(2, 132, 199, 0.4);
    box-shadow: inset 0 0 12px rgba(2, 132, 199, 0.1);
}

/* 7. Bottom Quick-Teleport Bar */
.berlin-vr-bottombar {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.berlin-vr-controls-hint {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-radius: 999px;
    padding: 5px 16px;
    font-size: 0.76rem;
    color: #334155;
    font-weight: 700;
    display: flex;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.berlin-vr-teleport-dock {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(2, 132, 199, 0.25);
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.berlin-vr-dock-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(248, 250, 252, 0.8);
    color: #334155;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.berlin-vr-dock-btn:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.berlin-vr-dock-btn.active {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.45);
}

/* 8. Department In-Place Instant Window Modal (Zero Reload / Instant 0ms) */
.berlin-vr-section-window {
    position: absolute;
    inset: 16px 22px;
    background: #0f172a;
    border: 2px solid rgba(2, 132, 199, 0.55);
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(2, 132, 199, 0.25);
    z-index: 100;
    pointer-events: auto;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: berlinWindowPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes berlinWindowPop {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.berlin-vr-section-window.active {
    display: flex;
}

.berlin-vr-window-header {
    height: 52px;
    background: linear-gradient(90deg, #0f172a, #1e293b);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.berlin-vr-window-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 800;
}

.berlin-vr-window-title i {
    color: #38bdf8;
    font-size: 1.1rem;
}

.berlin-vr-window-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.berlin-vr-window-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    border: 1px solid #ffffff;
    border-radius: 999px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    transition: all 0.2s ease;
}

.berlin-vr-window-back-btn:hover {
    background: linear-gradient(135deg, #0369a1, #0ea5e9);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.6);
}

.berlin-vr-window-exit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.berlin-vr-window-exit-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.berlin-vr-section-body {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px;
    box-sizing: border-box;
    background: #0b1120;
    color: #edf2f7;
}

.berlin-vr-section-body::-webkit-scrollbar {
    width: 8px;
}
.berlin-vr-section-body::-webkit-scrollbar-track {
    background: #0f172a;
}
.berlin-vr-section-body::-webkit-scrollbar-thumb {
    background: rgba(2, 132, 199, 0.4);
    border-radius: 4px;
}
.berlin-vr-section-body::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.7);
}

/* 9. Controls Help Modal */
.berlin-vr-terminal-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: min(500px, 92vw);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(2, 132, 199, 0.35);
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    z-index: 50;
    pointer-events: auto;
    display: none;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    color: #0f172a;
}

.berlin-vr-terminal-modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.berlin-vr-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #334155;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.berlin-vr-stat-value {
    font-weight: 800;
    color: #0284c7;
    font-size: 0.95rem;
}

/* ==========================================================================
   10. Administrative Modals & Delivery Elevation in VR Mode
   Ensures #email-modal, #product-modal, #auto-delivery-modal, and all dialogs
   render above #berlin-vr-overlay (z-index 2147483646) with pointer events enabled.
   ========================================================================== */
body.berlin-vr-active .modal-overlay,
body.berlin-vr-active .berlin-modal-overlay,
body.berlin-vr-active #email-modal,
body.berlin-vr-active #auto-delivery-modal,
body.berlin-vr-active #product-modal,
body.berlin-vr-active #view-vault-modal,
body.berlin-vr-active #whatsapp-modal,
body.berlin-vr-active #manual-orders-modal,
body.berlin-vr-active .admin-modal,
body.berlin-vr-active .swal2-container,
body.berlin-vr-active #berlin-order-details-modal,
body.berlin-vr-active #berlin-assign-project-modal,
body.berlin-vr-active #berlin-team-task-modal,
body:has(#berlin-vr-overlay.active) .modal-overlay,
body:has(#berlin-vr-overlay.active) .berlin-modal-overlay,
body:has(#berlin-vr-overlay.active) #email-modal,
body:has(#berlin-vr-overlay.active) #auto-delivery-modal,
body:has(#berlin-vr-overlay.active) #product-modal,
body:has(#berlin-vr-overlay.active) #view-vault-modal,
body:has(#berlin-vr-overlay.active) #whatsapp-modal,
body:has(#berlin-vr-overlay.active) #manual-orders-modal,
body:has(#berlin-vr-overlay.active) .swal2-container {
    z-index: 2147483646 !important;
    pointer-events: auto !important;
}

body.berlin-vr-active .modal-overlay .modal-box,
body.berlin-vr-active #email-modal .modal-box,
body.berlin-vr-active #auto-delivery-modal .modal-box,
body.berlin-vr-active #product-modal .modal-box,
body:has(#berlin-vr-overlay.active) .modal-overlay .modal-box,
body:has(#berlin-vr-overlay.active) #email-modal .modal-box,
body:has(#berlin-vr-overlay.active) #auto-delivery-modal .modal-box,
body:has(#berlin-vr-overlay.active) #product-modal .modal-box {
    position: relative;
    z-index: 2147483647 !important;
    pointer-events: auto !important;
}

/* Lower VR FAB behind Live Chat modal when open */
body.admin-live-chat-open #berlin-vr-fab {
    z-index: 10 !important;
    pointer-events: none !important;
}
