/* Copyright (c) 2026 Steven Burt James (Agentic Essence). All Rights Reserved.
 * Unified Sandboxed <SynthViewport /> & Synth Launcher Modal Stylesheet
 * Shared across Cyberdeck, Desktop, Website & Agentic Vox
 */

.synth-viewport {
    position: relative;
    width: 100%;
    margin: 10px 0;
    border-radius: 10px;
    background: rgba(6, 11, 22, 0.96);
    border: 1px solid rgba(0, 240, 255, 0.42);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.synth-viewport:hover,
.synth-viewport:focus-within {
    border-color: rgba(0, 255, 136, 0.6);
    box-shadow: 0 10px 32px rgba(0, 240, 255, 0.18);
}

.synth-viewport.is-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 999999 !important;
    background: #040711 !important;
}

.synth-vp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.14), rgba(10, 18, 36, 0.94));
    border-bottom: 1px solid rgba(0, 240, 255, 0.26);
    flex-wrap: wrap;
}

.synth-vp-title-group {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1 1 auto;
}

.synth-vp-badge {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.7px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(0, 240, 255, 0.16);
    color: #00f0ff;
    border: 1px solid rgba(0, 240, 255, 0.4);
}

.synth-viewport[data-synth-mode="2d_canvas"] .synth-vp-badge {
    background: rgba(0, 255, 136, 0.16);
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.45);
}

.synth-viewport[data-synth-mode="3d_webgl"] .synth-vp-badge {
    background: rgba(224, 170, 255, 0.18);
    color: #e0aaff;
    border-color: rgba(224, 170, 255, 0.45);
}

.synth-viewport[data-synth-mode="wasm_vm"] .synth-vp-badge {
    background: rgba(255, 183, 0, 0.16);
    color: #ffb700;
    border-color: rgba(255, 183, 0, 0.45);
}

.synth-vp-title {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11.5px;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.synth-vp-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.synth-vp-btn {
    appearance: none;
    background: rgba(15, 23, 42, 0.88);
    color: #cbd5e1;
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 5px;
    padding: 3px 7px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.3;
    transition: all 0.15s ease;
}

.synth-vp-btn:hover {
    background: rgba(0, 240, 255, 0.18);
    color: #00f0ff;
    border-color: #00f0ff;
}

.synth-vp-btn.active {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border-color: #00ff88;
}

.synth-vp-btn.danger:hover {
    background: rgba(255, 0, 127, 0.22);
    color: #ff4d94;
    border-color: #ff4d94;
}

.synth-vp-stage {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 340px;
    background: #050814;
    display: flex;
    flex-direction: column;
}

.synth-viewport.is-fullscreen .synth-vp-stage {
    height: calc(100vh - 46px) !important;
    min-height: calc(100vh - 46px) !important;
}

.synth-vp-iframe {
    width: 100%;
    min-height: 340px;
    height: 380px;
    border: none;
    display: block;
    background: #050814;
    flex: 1 1 auto;
}

.synth-viewport[data-synth-mode="2d_canvas"] .synth-vp-iframe,
.synth-viewport[data-synth-mode="3d_webgl"] .synth-vp-iframe,
.synth-viewport[data-synth-mode="wasm_vm"] .synth-vp-iframe {
    min-height: 370px;
    height: 410px;
}

.synth-viewport.is-fullscreen .synth-vp-iframe {
    height: 100% !important;
    min-height: 100% !important;
}

.synth-vp-inspector {
    display: none;
    border-top: 1px solid rgba(0, 240, 255, 0.25);
    background: #03060d;
    padding: 8px 10px;
}

.synth-vp-inspector.open {
    display: block;
}

.synth-vp-inspector-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}

.synth-vp-inspector-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.synth-vp-editor {
    width: 100%;
    height: 190px;
    background: #070d1a;
    color: #38bdf8;
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 6px;
    padding: 8px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    line-height: 1.45;
    resize: vertical;
    outline: none;
}

.synth-vp-editor:focus {
    border-color: #00ff88;
}

/* =========================================================================
 * LIVE SYNTH COMPILING INDICATOR
 * ========================================================================= */
.synth-compiling-card {
    border: 1px solid rgba(224, 170, 255, 0.45);
    background: linear-gradient(145deg, rgba(10, 15, 32, 0.96), rgba(5, 8, 20, 0.98));
    border-radius: 10px;
    padding: 16px;
    margin: 10px 0;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.synth-compiling-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.synth-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(224, 170, 255, 0.25);
    border-top-color: #00f0ff;
    border-right-color: #e0aaff;
    animation: synthSpin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.synth-compiling-bar {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    overflow: hidden;
    margin-top: 10px;
}

.synth-compiling-bar-fill {
    width: 42%;
    height: 100%;
    background: linear-gradient(90deg, #00f0ff, #e0aaff, #00ff88);
    border-radius: 999px;
    animation: synthSweep 1.35s ease-in-out infinite alternate;
}

@keyframes synthSweep {
    0% { transform: translateX(-15%); }
    100% { transform: translateX(155%); }
}

/* =========================================================================
 * IN-DOM HOLOGRAPHIC SYNTH & TEXT LAUNCHER MODAL
 * ========================================================================= */
.synth-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 15, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.synth-modal-dialog {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(165deg, rgba(10, 17, 36, 0.98), rgba(5, 9, 20, 0.99));
    border: 1px solid rgba(224, 170, 255, 0.48);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.78), 0 0 28px rgba(0, 240, 255, 0.14);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'JetBrains Mono', sans-serif;
    color: #f1f5f9;
}

.synth-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.synth-modal-title {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    font-weight: 800;
    color: #e0aaff;
    letter-spacing: 0.6px;
}

.synth-modal-sub {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.45;
    margin-bottom: 10px;
}

.synth-modal-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 74px;
    background: #040813;
    color: #f8fafc;
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 9px;
    padding: 10px 12px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    line-height: 1.45;
    resize: vertical;
    outline: none;
}

.synth-modal-input:focus {
    border-color: #00ff88;
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.16);
}

.synth-modal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.synth-modal-chip {
    appearance: none;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #cbd5e1;
    border-radius: 999px;
    padding: 4px 10px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.synth-modal-chip:hover {
    border-color: #e0aaff;
    color: #e0aaff;
    background: rgba(224, 170, 255, 0.14);
}

.synth-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.synth-modal-btn {
    appearance: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.9);
    color: #cbd5e1;
}

.synth-modal-btn.primary {
    background: linear-gradient(135deg, #00f0ff, #00ff88);
    color: #040711;
    border: none;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.3);
}
