/* ==========================================================================
   Isaac Sim Web Bridge — base theme
   ========================================================================== */

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

body {
    font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
    background: #09090b;
    color: #fafafa;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Main layout
   ========================================================================== */

#main {
    display: grid;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

#main > * {
    min-width: 0;
    min-height: 0;
}

/* ==========================================================================
   Viewport — stream + overlay container
   ========================================================================== */

#viewport {
    position: relative;
    overflow: hidden;
    background: #09090b;
}

#stream-container {
    width: 100%;
    height: 100%;
}

#stream-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    min-height: 0;
}

#overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#overlay-container canvas {
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#viewport.overlay-active #overlay-container canvas {
    opacity: 1;
}

#viewport.threejs-primary #overlay-container canvas {
    opacity: 1;
}

/* ==========================================================================
   Viewport mode buttons (created by isaac-bridge.js)
   ========================================================================== */

#viewport-modes {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    z-index: 10;
    background: rgba(9, 9, 11, 0.7);
    border-radius: 6px;
    padding: 3px;
}

.viewport-mode-btn {
    padding: 3px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #71717a;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.viewport-mode-btn:hover {
    color: #d4d4d8;
}

.viewport-mode-btn.active {
    background: #27272a;
    color: #fafafa;
}

/* ==========================================================================
   Isaac Sim status indicator
   ========================================================================== */

.isaac-status {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.isaac-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.isaac-status--offline {
    color: #a1a1aa;
}

.isaac-status--offline::before {
    background: #52525b;
}

.isaac-status--connecting {
    color: #fbbf24;
}

.isaac-status--connecting::before {
    background: #fbbf24;
    animation: pulse-dot 1.5s infinite;
}

.isaac-status--online {
    color: #4ade80;
}

.isaac-status--online::before {
    background: #4ade80;
}

#viewport .isaac-status {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ==========================================================================
   Scrollbar styling
   ========================================================================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}
