/* ───────────────────────────────────────────────
   Glass Morphism — Firm D Spatial Studios v2
   ─────────────────────────────────────────────── */

/* Custom cursor */
.spatial-cursor {
    position: fixed;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(76, 170, 255, 0.9);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
    transform-origin: center;
}

.spatial-cursor-trail {
    position: fixed;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(76, 170, 255, 0.4);
    pointer-events: none;
    z-index: 9998;
    backdrop-filter: invert(5%);
}

/* ── Glass Panel Core ── */
.glass-panel {
    background: rgba(255, 255, 255, 0.065);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.18),
        0 1px 0px rgba(255, 255, 255, 0.15) inset,
        0 -1px 0px rgba(0, 0, 0, 0.2) inset;
    padding: 22px;
    color: rgba(255, 255, 255, 0.92);
    transition: box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                border-color 0.4s ease;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform-style: preserve-3d;
}

/* Top shine edge */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.3) 30%,
        rgba(255,255,255,0.5) 50%,
        rgba(255,255,255,0.3) 70%,
        transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Mouse-follow radial glow */
.glass-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        260px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255,255,255,0.09) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}

.glass-panel.mouse-over::after {
    opacity: 1;
}

/* Per-panel accent glows */
#engineering-panel {
    --accent: rgba(76, 170, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 40px rgba(76,170,255,0.06) inset;
}
#engineering-panel:hover {
    border-color: rgba(76, 170, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 60px rgba(76,170,255,0.12) inset;
}

#marketing-panel {
    --accent: rgba(167, 139, 250, 0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 40px rgba(167,139,250,0.06) inset;
}
#marketing-panel:hover {
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 60px rgba(167,139,250,0.12) inset;
}

#intelligence-panel {
    --accent: rgba(6, 182, 212, 0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 40px rgba(6,182,212,0.06) inset;
}
#intelligence-panel:hover {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 60px rgba(6,182,212,0.12) inset;
}

#security-panel {
    --accent: rgba(52, 211, 153, 0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 40px rgba(52,211,153,0.06) inset;
}
#security-panel:hover {
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 60px rgba(52,211,153,0.12) inset;
}

#operations-panel {
    --accent: rgba(251, 191, 36, 0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 40px rgba(251,191,36,0.05) inset;
}
#operations-panel:hover {
    border-color: rgba(251, 191, 36, 0.25);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 60px rgba(251,191,36,0.1) inset;
}

.glass-panel.expanded {
    z-index: 100;
    transform: scale(1.08) translateZ(30px) !important;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 80px rgba(255,255,255,0.05) inset;
    border-color: rgba(255,255,255,0.25);
}

/* ── Panel Header ── */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 2;
}

.panel-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Inter', sans-serif;
}

.panel-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.panel-controls button {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    font-size: 0.9rem;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}
.panel-controls button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255,255,255,0.2);
}

/* ── Metrics ── */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    position: relative;
    z-index: 2;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 10px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: all 0.3s ease;
    cursor: default;
    gap: 4px;
}

.metric:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-4px) translateZ(8px);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.metric-value {
    font-size: 1.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #e8e8e8 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.metric-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-weight: 500;
}

.sparkline-container {
    margin-top: 6px;
    color: rgba(255,255,255,0.4);
    line-height: 0;
}

.sparkline {
    display: block;
}

/* ── Status Beacon ── */
.status-beacon {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
}

.beacon-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: beacon-pulse 2.4s ease-in-out infinite;
}

@keyframes beacon-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.55; transform: scale(0.8); }
}

.beacon-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

/* ── Spatial Status Bar ── */
.spatial-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    letter-spacing: 0.4px;
    position: relative;
    z-index: 10;
    animation: fadeInDown 0.8s ease forwards;
}

.sb-left, .sb-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sb-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: beacon-pulse 2s ease-in-out infinite;
}

.sb-dot.live {
    background: #4caaff;
    box-shadow: 0 0 6px #4caaff;
}

.sb-sep {
    opacity: 0.35;
}

.sb-time {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.85);
}

.sb-hint {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    font-family: monospace;
    background: rgba(255,255,255,0.06);
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ── Command Palette ── */
.command-palette {
    position: fixed !important;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: min(600px, 92vw);
    z-index: 9990 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.cp-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cp-icon {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.4);
}

.cp-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    caret-color: #4caaff;
}
.cp-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.cp-hint {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.25);
    font-family: monospace;
    background: rgba(255,255,255,0.06);
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
}

.cp-results {
    padding: 8px 0;
}

.cp-result {
    padding: 10px 18px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cp-result:hover,
.cp-result.active {
    background: rgba(76,170,255,0.12);
    color: rgba(255,255,255,0.95);
}

/* ── Floating Window ── */
.floating-window {
    position: absolute;
    min-width: 280px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.12);
    animation-fill-mode: forwards;
}

.floating-window .panel-header {
    cursor: grab;
}
.floating-window .panel-header:active {
    cursor: grabbing;
}

.notification-item {
    display: flex;
    padding: 10px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 10px;
    align-items: center;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.notification-item:hover {
    background: rgba(255,255,255,0.05);
}
.notification-item.new {
    background: rgba(76,170,255,0.08);
    border-left: 2px solid rgba(76,170,255,0.6);
    padding-left: 8px;
}
.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.notification-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}
.notification-time {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    font-size: 0.95rem;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.close-btn:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.95);
}

/* ── Panel content z-layering ── */
.panel-content {
    height: calc(100% - 50px);
    overflow: hidden;
    position: relative;
    z-index: 2;
}
