/* ───────────────────────────────────────────────
   Floating Windows — Spatial depth + glass + motion
   Firm D (Spatial Studios) — Mission Control v3
   ─────────────────────────────────────────────── */

.floating-window {
    position: fixed;
    border-radius: 16px;
    backdrop-filter: blur(24px) saturate(180%);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    will-change: transform;
    cursor: grab;
}

.floating-window:hover {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px) scale(1.01);
}

.floating-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    opacity: 0.5;
}

.float-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    cursor: grab;
    user-select: none;
}

.float-header:active {
    cursor: grabbing;
}

.float-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.5px;
}

.float-controls {
    display: flex;
    gap: 6px;
}

.float-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.float-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.float-btn.close:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fff;
}

.float-content {
    padding: 12px 14px;
    overflow-y: auto;
    max-height: calc(100% - 40px);
}

/* Notification items */
.notification-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
    animation: beacon-pulse 2s ease-in-out infinite;
}

.notif-text {
    flex: 1;
}

.notif-text strong {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
}

.notif-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Quick stats */
.quick-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.quick-stat:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.04) 100%
    );
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

.qs-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.qs-value {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Sparkline canvas */
#sparkline-canvas {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Depth-based z-index layering */
.floating-window[data-depth="6"] { z-index: 106; }
.floating-window[data-depth="5"] { z-index: 105; }
.floating-window[data-depth="4"] { z-index: 104; }
.floating-window[data-depth="3"] { z-index: 103; }

/* Health metrics */
.health-metric {
    margin-bottom: 14px;
}

.health-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.3px;
}

.health-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #fff;
    flex-shrink: 0;
}

.health-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
    position: relative;
}

.health-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.health-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.health-value {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .floating-window {
        width: 90vw !important;
        left: 5vw !important;
    }
}

/* Beacon pulse animation */
@keyframes beacon-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Alert Feed Styles */
.alert-feed-scroll {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.alert-feed-scroll::-webkit-scrollbar {
    width: 4px;
}

.alert-feed-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 2px;
}

.alert-feed-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.alert-feed-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.alert-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(3px);
}

.alert-critical {
    border-left: 3px solid rgba(239, 68, 68, 0.8);
    background: rgba(239, 68, 68, 0.05);
}

.alert-warning {
    border-left: 3px solid rgba(251, 191, 36, 0.8);
    background: rgba(251, 191, 36, 0.05);
}

.alert-info {
    border-left: 3px solid rgba(76, 170, 255, 0.8);
    background: rgba(76, 170, 255, 0.05);
}

.alert-success {
    border-left: 3px solid rgba(52, 211, 153, 0.8);
    background: rgba(52, 211, 153, 0.05);
}

.alert-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-details {
    flex: 1;
}

.alert-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3px;
    letter-spacing: 0.2px;
}

.alert-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 4px;
    line-height: 1.3;
}

.alert-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
}

/* Enhanced depth for 5th window */
.floating-window[data-depth="7"] { 
    z-index: 107;
    box-shadow:
        0 16px 56px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
