:root {
    --os-bg: rgba(2, 6, 23, 0.98);
    --os-primary: #00f2ff;
    --os-secondary: #7000ff;
    --os-accent: #facc15;
    --os-danger: #ef4444;
    --os-text: #f8fafc;
    --os-glass: rgba(15, 23, 42, 0.8);
    --os-border: rgba(255, 255, 255, 0.1);
}

#operatingSystemOverlay {
    position: fixed;
    inset: 0;
    background: var(--os-bg);
    backdrop-filter: blur(25px);
    z-index: 1000000;
    display: none;
    flex-direction: column;
    color: var(--os-text);
    font-family: 'Inter', sans-serif;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow-y: auto;
}

#operatingSystemOverlay.active {
    display: flex;
    opacity: 1;
}

.os-header {
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--os-border);
}

.os-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.os-brand i {
    color: var(--os-primary);
    filter: drop-shadow(0 0 10px var(--os-primary));
}

.os-status-bar {
    display: flex;
    gap: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.status-dot.pulse {
    animation: osPulse 2s infinite;
}

@keyframes osPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.os-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: 0.3s;
}

.os-close:hover {
    color: var(--os-primary);
    transform: rotate(90deg);
}

.os-content {
    flex: 1;
    padding: 50px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Brain UI */
.brain-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.health-card {
    background: var(--os-glass);
    border: 1px solid var(--os-border);
    padding: 25px;
    border-radius: 24px;
    text-align: center;
    transition: 0.3s;
}

.health-card:hover {
    border-color: var(--os-primary);
    background: rgba(0, 242, 255, 0.05);
}

.health-val {
    font-size: 2.5rem;
    font-weight: 950;
    display: block;
    margin-bottom: 5px;
}

.health-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 800;
}

.decision-engine {
    background: linear-gradient(135deg, rgba(112, 0, 255, 0.1), rgba(0, 242, 255, 0.1));
    border: 1px solid rgba(0, 242, 255, 0.3);
    padding: 40px;
    border-radius: 32px;
    position: relative;
    overflow: hidden;
}

.decision-engine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(0, 242, 255, 0.1), transparent 30%);
    animation: rotateEngine 10s linear infinite;
    pointer-events: none;
}

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

.decision-title {
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--os-primary);
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.decision-output {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 30px;
}

.action-layer {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.os-btn {
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.os-btn-primary {
    background: var(--os-primary);
    color: #000;
}

.os-btn-primary:hover {
    box-shadow: 0 0 20px var(--os-primary);
    transform: translateY(-3px);
}

.os-btn-outline {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--os-border);
}

.os-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* Sidebar Signals */
.signals-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.signal-group {
    background: var(--os-glass);
    border: 1px solid var(--os-border);
    padding: 30px;
    border-radius: 28px;
}

.signal-title {
    font-size: 1rem;
    font-weight: 900;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
}

.signal-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.signal-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.signal-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.signal-info h5 {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0 0 5px;
}

.signal-info p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

/* Floating Button */
.os-fab {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 100000;
    background: #000;
    color: var(--os-primary);
    border: 1px solid var(--os-primary);
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 242, 255, 0.3);
    transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.os-fab:hover {
    transform: scale(1.05) translateY(-5px);
    background: var(--os-primary);
    color: #000;
}

.os-fab i {
    font-size: 1.2rem;
}

@media (max-width: 1024px) {
    .os-content {
        grid-template-columns: 1fr;
    }
}
