/* ==========================================================================
   COGNITIVE SYNAPSE - Visualizer Stylesheet (1-to-1 Localhost Glass Shell)
   ========================================================================== */

.visualizer-fullscreen-shell {
    position: relative;
    width: 100%;
    height: calc(100vh - 76px);
    min-height: 650px;
    background-color: #070814;
    overflow: hidden;
    color: #f1f5f9;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    user-select: none;
}

/* Background Canvas & Grid */
.visualizer-fullscreen-shell .canvas-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.visualizer-fullscreen-shell #thoughtCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.visualizer-fullscreen-shell .canvas-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 40%, rgba(7, 8, 20, 0.8) 100%);
    pointer-events: none;
}

.visualizer-fullscreen-shell .canvas-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

/* Glass Panels */
.visualizer-fullscreen-shell .glass {
    background: rgba(14, 17, 34, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* App Shell Layout */
.visualizer-fullscreen-shell .app-layout {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 20px;
    gap: 16px;
    pointer-events: none;
}

.visualizer-fullscreen-shell .app-layout > * {
    pointer-events: auto;
}

/* Header Controls */
.visualizer-fullscreen-shell .app-header-overlay {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(11, 14, 29, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.visualizer-fullscreen-shell .view-mode-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.visualizer-fullscreen-shell .mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.visualizer-fullscreen-shell .mode-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.06);
}

.visualizer-fullscreen-shell .mode-btn.active {
    background: rgba(0, 243, 255, 0.12);
    color: #00f3ff;
    border: 1px solid rgba(0, 243, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
}

.visualizer-fullscreen-shell .header-controls {
    display: flex;
    gap: 10px;
}

.visualizer-fullscreen-shell .icon-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.visualizer-fullscreen-shell .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.visualizer-fullscreen-shell .hidden { display: none !important; }

/* Main App Body Grid */
.visualizer-fullscreen-shell .app-body {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

/* Compact Mode for Single Dialogue Pages & Shortcodes */
.visualizer-fullscreen-shell.controls-compact .app-body {
    grid-template-columns: 1fr;
    padding: 10px;
}

.visualizer-fullscreen-shell.controls-compact .app-header-overlay {
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(-8px);
}

.visualizer-fullscreen-shell.controls-compact:hover .app-header-overlay,
.visualizer-fullscreen-shell.controls-compact.show-controls .app-header-overlay {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.visualizer-fullscreen-shell.controls-compact .left-panel,
.visualizer-fullscreen-shell.controls-compact .right-panel {
    display: none;
    position: absolute;
    top: 70px;
    bottom: 20px;
    width: 320px;
    z-index: 50;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.visualizer-fullscreen-shell.controls-compact .left-panel {
    left: 20px;
}

.visualizer-fullscreen-shell.controls-compact .right-panel {
    right: 20px;
}

.visualizer-fullscreen-shell.show-controls .left-panel,
.visualizer-fullscreen-shell.show-controls .right-panel {
    display: flex !important;
}

@media (max-width: 992px) {
    .visualizer-fullscreen-shell .app-body {
        grid-template-columns: 1fr;
    }
    .visualizer-fullscreen-shell .right-panel {
        display: none;
    }
}

/* Panels */
.visualizer-fullscreen-shell .panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    overflow-y: auto;
}

.visualizer-fullscreen-shell .panel::-webkit-scrollbar {
    width: 4px;
}

.visualizer-fullscreen-shell .panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.visualizer-fullscreen-shell .panel-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.visualizer-fullscreen-shell .panel-section.flex-grow {
    flex: 1;
    min-height: 0;
}

.visualizer-fullscreen-shell .section-title {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.visualizer-fullscreen-shell .section-title svg {
    color: #00f3ff;
}

/* Presets */
.visualizer-fullscreen-shell .preset-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.visualizer-fullscreen-shell .preset-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    color: #f1f5f9;
}

.visualizer-fullscreen-shell .preset-card:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(3px);
}

.visualizer-fullscreen-shell .preset-card.active {
    background: rgba(0, 243, 255, 0.08);
    border-color: rgba(0, 243, 255, 0.35);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.visualizer-fullscreen-shell .preset-icon {
    font-size: 1.2rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.visualizer-fullscreen-shell .preset-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.visualizer-fullscreen-shell .preset-info p {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Form */
.visualizer-fullscreen-shell .thought-input-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.visualizer-fullscreen-shell #customThoughtInput {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    color: #f1f5f9;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    resize: none;
    outline: none;
}

.visualizer-fullscreen-shell #customThoughtInput:focus {
    border-color: #00f3ff;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.2);
}

.visualizer-fullscreen-shell .submit-thought-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.2), rgba(157, 78, 221, 0.2));
    border: 1px solid rgba(0, 243, 255, 0.4);
    color: #fff;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.visualizer-fullscreen-shell .submit-thought-btn:hover {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.35), rgba(157, 78, 221, 0.35));
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

/* Sliders */
.visualizer-fullscreen-shell .slider-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.visualizer-fullscreen-shell .slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    color: #94a3b8;
}

.visualizer-fullscreen-shell input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.visualizer-fullscreen-shell input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #00f3ff;
    cursor: pointer;
    box-shadow: 0 0 10px #00f3ff;
}

/* Center HUD */
.visualizer-fullscreen-shell .center-focus-hud {
    position: relative;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10px;
}

.visualizer-fullscreen-shell .active-thought-badge {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    background: rgba(14, 17, 34, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 30px;
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.15);
    font-size: 0.85rem;
    font-weight: 500;
}

.visualizer-fullscreen-shell .badge-dot {
    width: 8px;
    height: 8px;
    background: #00f3ff;
    border-radius: 50%;
    box-shadow: 0 0 8px #00f3ff;
    animation: blink 1.5s infinite alternate;
}

@keyframes blink {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Right Telemetry */
.visualizer-fullscreen-shell .telemetry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.visualizer-fullscreen-shell .metric-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.visualizer-fullscreen-shell .metric-label {
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.visualizer-fullscreen-shell .metric-value {
    font-family: 'Fira Code', monospace;
    font-size: 1.1rem;
    font-weight: 600;
}

.visualizer-fullscreen-shell .metric-value.cyan { color: #00f3ff; }
.visualizer-fullscreen-shell .metric-value.violet { color: #9d4edd; }
.visualizer-fullscreen-shell .metric-value.rose { color: #ff2a85; }
.visualizer-fullscreen-shell .metric-value.gold { color: #ffd166; }

.visualizer-fullscreen-shell .bar-bg {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

.visualizer-fullscreen-shell .bar-fill {
    height: 100%;
    transition: width 0.4s ease;
}

.visualizer-fullscreen-shell .bar-fill.cyan { background: #00f3ff; }
.visualizer-fullscreen-shell .bar-fill.violet { background: #9d4edd; }
.visualizer-fullscreen-shell .bar-fill.rose { background: #ff2a85; }
.visualizer-fullscreen-shell .bar-fill.gold { background: #ffd166; }

/* Stage Pipeline */
.visualizer-fullscreen-shell .stage-pipeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.visualizer-fullscreen-shell .stage-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s ease;
}

.visualizer-fullscreen-shell .stage-step.done {
    border-color: rgba(6, 214, 160, 0.3);
    background: rgba(6, 214, 160, 0.05);
}

.visualizer-fullscreen-shell .stage-step.active {
    border-color: rgba(0, 243, 255, 0.4);
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.visualizer-fullscreen-shell .step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.visualizer-fullscreen-shell .stage-step.done .step-num { background: #06d6a0; color: #000; }
.visualizer-fullscreen-shell .stage-step.active .step-num { background: #00f3ff; color: #000; }

.visualizer-fullscreen-shell .step-info h4 {
    font-size: 0.78rem;
    font-weight: 600;
}

.visualizer-fullscreen-shell .step-desc {
    font-size: 0.68rem;
    color: #94a3b8;
}

/* AI Log */
.visualizer-fullscreen-shell .telemetry-log {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.visualizer-fullscreen-shell .log-entry {
    display: flex;
    gap: 6px;
    word-break: break-word;
}

.visualizer-fullscreen-shell .log-time {
    color: #64748b;
    flex-shrink: 0;
}

.visualizer-fullscreen-shell .log-msg {
    color: #94a3b8;
}

.visualizer-fullscreen-shell .log-msg.cyan { color: #00f3ff; }
.visualizer-fullscreen-shell .log-msg.gold { color: #ffd166; }
.visualizer-fullscreen-shell .log-msg.rose { color: #ff2a85; }
