/* ═══════════════════════════════════════════════════════════════
   wit-immersive.css — Wave 13 Immersive Visual Design System
   ═══════════════════════════════════════════════════════════════
   
   Holographic & Glassmorphism Aesthetics:
   - Multi-layer glass with dynamic blur, neon outlines, depth shadows
   - Holographic shimmer and scan-line effects
   - Fluid glow animations for interactive elements
   
   Micro-Mini Interactions:
   - Subtle haptic-like visual feedback (scale, glow, ripple)
   - Touch/click response animations (50-150ms)
   - Status-driven glow pulses
   
   Spatial UI foundations:
   - Floating element system with depth layers (z-space)
   - Perspective transforms for cinematic depth
   - AR overlay container with camera backdrop support
   
   All variables cascade from tenant theme CSS variables (--wit-*).
   Works with all 7 design kits: Futuristic, Glass, Neon, Minimal,
   Nature, Ocean, Corporate.
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. HOLOGRAPHIC GLASSMORPHISM ─────────────────────────── */

/* Base glass surface — use on cards, panels, modals */
.glass-surface {
    background: var(--wit-glass-bg);
    -webkit-backdrop-filter: blur(var(--wit-glass-blur));
    backdrop-filter: blur(var(--wit-glass-blur));
    border: 1px solid var(--wit-glass-border);
    border-radius: var(--wit-border-radius);
    transition: all var(--wit-animation-speed) ease;
}

/* Holographic variant — iridescent shimmer effect */
.glass-holographic {
    position: relative;
    overflow: hidden;
    -webkit-backdrop-filter: blur(var(--wit-glass-blur));
    backdrop-filter: blur(var(--wit-glass-blur));
}
.glass-holographic::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(59, 130, 246, 0.1) 60deg,
        rgba(232, 121, 249, 0.1) 120deg,
        rgba(34, 211, 238, 0.1) 180deg,
        rgba(59, 130, 246, 0.1) 240deg,
        transparent 300deg
    );
    animation: holographic-rotate 8s linear infinite;
    pointer-events: none;
    z-index: 0;
}
.glass-holographic > * {
    position: relative;
    z-index: 1;
}

@keyframes holographic-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Deep glass — multiple blur layers for cinematic depth */
.glass-deep {
    position: relative;
    background: var(--wit-glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--wit-glass-border);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.glass-deep::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.02) 100%
    );
    pointer-events: none;
}

/* Neon outline — pulsing glow border */
.neon-outline {
    position: relative;
    border: 1px solid var(--wit-accent);
    box-shadow: var(--wit-accent-glow);
    transition: box-shadow var(--wit-animation-speed) ease;
}
.neon-outline:hover {
    box-shadow: 
        var(--wit-accent-glow),
        0 0 40px var(--wit-accent);
}

/* Scan-line overlay for HUD effect */
.scan-lines {
    position: relative;
    overflow: hidden;
}
.scan-lines::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* ─── 2. MICRO-MINI INTERACTIONS ───────────────────────────── */

/* Tap feedback — subtle press scale */
.micro-tap {
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.micro-tap:active {
    transform: scale(0.97);
}

/* Glow ripple on click */
.micro-ripple {
    position: relative;
    overflow: hidden;
}
.micro-ripple::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), 
        var(--wit-accent) 0%,
        transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.micro-ripple:active::after {
    opacity: 0.3;
}

/* Hover glow — subtle accent lift */
.micro-hover-glow {
    transition: box-shadow var(--wit-animation-speed) ease,
                transform var(--wit-animation-speed) ease;
}
.micro-hover-glow:hover {
    box-shadow: var(--wit-accent-glow);
    transform: translateY(-2px);
}

/* Status pulse — for live indicators (online, active, alert) */
.micro-pulse {
    animation: micro-pulse 2s ease-in-out infinite;
}
@keyframes micro-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* Success flash — brief green glow on completed action */
.micro-success-flash {
    animation: success-flash 0.6s ease;
}
@keyframes success-flash {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50% { box-shadow: 0 0 20px 4px rgba(34, 197, 94, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Error shake — brief horizontal shake on error */
.micro-error-shake {
    animation: error-shake 0.4s ease;
}
@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* Data refresh shimmer — for updating content */
.micro-shimmer {
    position: relative;
    overflow: hidden;
}
.micro-shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%
    );
    animation: shimmer-slide 2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes shimmer-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* ─── 3. SPATIAL UI & DEPTH ────────────────────────────────── */

/* Floating element — subtle hover/float animation */
.spatial-float {
    animation: spatial-float 3s ease-in-out infinite;
}
@keyframes spatial-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

/* Depth layers — z-space positioning */
.depth-layer-0 { z-index: 0; }
.depth-layer-1 { z-index: 10; }
.depth-layer-2 { z-index: 20; }
.depth-layer-3 { z-index: 30; }

/* Perspective container for 3D tilt effects */
.spatial-perspective {
    perspective: 1000px;
    perspective-origin: 50% 50%;
}

/* Tilt card — 3D tilt on hover (like Apple Music) */
.spatial-tilt {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}
.spatial-tilt:hover {
    transform: 
        rotateX(var(--tilt-x, 0deg))
        rotateY(var(--tilt-y, 0deg))
        translateZ(20px);
}

/* Parallax depth — different scroll speeds */
.parallax-slow { transform: translateZ(-2px) scale(1.02); }
.parallax-normal { transform: translateZ(0); }
.parallax-fast { transform: translateZ(1px); }

/* ─── 4. AR OVERLAY CONTAINER ──────────────────────────────── */

/* AR overlay — positioned over camera feed */
.ar-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}
.ar-overlay > * {
    pointer-events: auto;
}

/* AR floating label — attaches to real-world positions */
.ar-label {
    position: absolute;
    padding: 4px 10px;
    background: var(--wit-glass-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--wit-accent);
    border-radius: 6px;
    font-size: 12px;
    color: var(--wit-text-primary);
    white-space: nowrap;
    transform: translate(-50%, -100%);
}
.ar-label::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--wit-accent);
}

/* ─── 5. THEME-SPECIFIC ADAPTATIONS ────────────────────────── */

/* Futuristic theme — neon glow + scan lines */
[data-theme="futuristic"] .glass-surface {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

/* Glass theme — softer, more transparent */
[data-theme="glass"] .glass-surface {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* Neon theme — intense glow */
[data-theme="neon"] .glass-surface {
    border-color: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2), inset 0 0 15px rgba(0, 255, 255, 0.05);
}

/* Minimal theme — no glass, clean edges */
[data-theme="minimal"] .glass-surface {
    background: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ─── 6. UTILITY ANIMATIONS ────────────────────────────────── */

/* Fade in with slide */
.animate-fade-in {
    animation: fade-in 0.3s ease forwards;
}
@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Slide in from the right (Ideas 67: overlay panels / inspector trays).
   will-change promotes the element to its own GPU layer before the animation runs. */
.animate-slide-in-right {
    animation: slide-in-right 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform;
}
@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(40px) scaleX(0.98); }
    to { opacity: 1; transform: translateX(0) scaleX(1); }
}

/* Screen-reader-only text. Standard utility: the app had NO definition and no Bootstrap, so a
   component using it would render the text VISIBLY (found when WitSkeleton introduced one). */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Block skeleton (Ideas 68): placeholder while async data loads. Reuses the existing
   shimmer-slide sweep; no large backdrop-blur (Ideas 67 perf rule on mobile GPUs). */
.wit-skeleton {
    position: relative;
    overflow: hidden;
    width: 100%;
}
.wit-skeleton-line {
    display: block;
    height: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    background: rgba(148, 163, 184, 0.25);
}
.wit-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.18), transparent);
    animation: shimmer-slide 1.8s ease-in-out infinite;
    pointer-events: none;
}

/* Scale in (for modals, cards) */
.animate-scale-in {
    animation: scale-in 0.2s ease forwards;
}
@keyframes scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Glow pulse for attention */
.animate-glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}
@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 5px var(--wit-accent); }
    50% { box-shadow: 0 0 20px var(--wit-accent), 0 0 40px var(--wit-accent); }
}
