/* Observatory Base Styles */
/* Shared styles, resets, and variables */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --color-bg: #000000;
    --color-text: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.7);
    --color-text-tertiary: rgba(255, 255, 255, 0.5);

    /* Agent Colors */
    --color-agent-1: #facc15;
    --color-agent-2: #22c55e;

    /* Service Colors */
    --color-service-1: #3b82f6;
    --color-service-2: #a855f7;

    /* Infrastructure Colors */
    --color-infra-1: #f97316;
    --color-infra-2: #ef4444;

    /* Status Colors */
    --color-active: #22c55e;
    --color-idle: #facc15;
    --color-error: #ef4444;

    /* Glass Effect */
    --glass-bg: rgba(15, 15, 15, 0.75);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-border-hover: rgba(255, 255, 255, 0.3);
    --glass-blur: 20px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Z-index layers */
    --z-canvas: 1;
    --z-cards: 50;
    --z-topbar: 100;
    --z-dock: 150;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Canvas - Full screen background for 3D */
#canvas3d {
    width: 100%;
    height: 100%;
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-canvas);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Mac-Style Menu Bar */
#menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: var(--z-topbar);
    font-size: 13px;
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-logo {
    height: 18px;
    width: auto;
    object-fit: contain;
}

.menu-item {
    color: rgba(255, 255, 255, 0.9);
    cursor: default;
    user-select: none;
}

.menu-item.active {
    font-weight: 600;
    color: #ffffff;
}

.menu-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-stats {
    display: flex;
    gap: 16px;
}

.menu-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-stat-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.menu-stat-value {
    color: var(--color-active);
    font-weight: 600;
    font-size: 12px;
}

.menu-time {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    min-width: 120px;
    text-align: right;
}

/* Dropdown Menus */
.dropdown-trigger {
    position: relative;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.15s ease;
    font-weight: 500;
    white-space: nowrap;
}

.dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dropdown-trigger.active {
    background: rgba(255, 255, 255, 0.12);
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    margin-top: 8px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10000;
}

.dropdown-trigger.active .menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-dropdown-item {
    padding: 10px 18px;
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.menu-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.menu-dropdown-item:active {
    background: rgba(255, 255, 255, 0.2);
}

.menu-dropdown-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 6px 12px;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-active);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loading-screen p {
    margin-top: 24px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

#loading-progress {
    margin-top: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    min-height: 20px;
}

/* Empty State */
#empty-state {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    max-width: 480px;
    z-index: 100;
}

#empty-state h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--color-text);
}

#empty-state p {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

#empty-state .btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--color-active);
    color: #000;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 14px;
}

#empty-state .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 60px;
    right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-toast.error {
    border-left: 4px solid var(--color-error);
}

.notification-toast.success {
    border-left: 4px solid var(--color-active);
}

.notification-toast.warning {
    border-left: 4px solid var(--color-idle);
}

.notification-toast h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.notification-toast p {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* Keyboard Shortcuts Overlay */
#keyboard-shortcuts {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#keyboard-shortcuts.visible {
    opacity: 1;
    visibility: visible;
}

.shortcuts-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.shortcuts-panel h2 {
    margin: 0 0 24px 0;
    font-size: 24px;
    color: var(--color-text);
}

.shortcuts-grid {
    display: grid;
    gap: 16px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-desc {
    color: var(--color-text-secondary);
    font-size: 14px;
}

.shortcut-keys {
    display: flex;
    gap: 6px;
}

.key {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--color-text);
    font-weight: 600;
}

.shortcuts-close {
    margin-top: 24px;
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 13px;
}