/* ==========================================================================
   Thrust & Thread Telemetry Stylesheet
   Contains styling for:
   - Multi-step state-machine intake wizard
   - Glassmorphic command-line chatbot console
   ========================================================================== */

/* ==========================================================================
   1. Multi-Step Discovery Intake Wizard UI
   ========================================================================== */
.wizard-container {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 3rem;
    margin: 3rem auto;
    max-width: 720px;
    box-shadow: var(--shadow-md);
}

.wizard-progress {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 3.5rem;
}

/* Connecting line behind progress indicators */
.wizard-progress::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 5%;
    right: 5%;
    height: 2px;
    background: var(--color-bg-tertiary);
    z-index: 1;
}

.step-node {
    position: relative;
    z-index: 2;
    text-align: center;
    flex-grow: 1;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-node::before {
    content: '';
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    color: var(--color-text-muted);
}

/* Setup dynamic node label counters */
.step-node[data-step="1"]::before { content: '01'; }
.step-node[data-step="2"]::before { content: '02'; }
.step-node[data-step="3"]::before { content: '03'; }
.step-node[data-step="4"]::before { content: '04'; }

.step-node.active {
    color: var(--color-accent-primary);
}

.step-node.active::before {
    background: var(--color-bg-primary);
    border-color: var(--color-accent-primary);
    color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow);
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    animation: wizardFadeIn 0.4s ease;
}

@keyframes wizardFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-step h4 {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.75rem;
    font-family: var(--font-heading);
    color: var(--color-text-primary);
}

.wizard-step label {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.wizard-step select,
.wizard-step input[type="text"],
.wizard-step input[type="number"],
.wizard-step input[type="email"],
.wizard-step textarea {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    padding: 0.9rem;
    border-radius: 6px;
    color: var(--color-text-primary);
    font-size: 1rem;
    width: 100%;
    transition: var(--transition-smooth);
}

.wizard-step select:focus,
.wizard-step input:focus,
.wizard-step textarea:focus {
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow);
    outline: none;
}

.wizard-step textarea {
    height: 140px;
    resize: vertical;
}

.verification-notice {
    font-size: 0.95rem;
    color: #cbd5e1;
    background: rgba(56, 189, 248, 0.03);
    border: 1px solid rgba(56, 189, 248, 0.1);
    padding: 1.25rem;
    border-radius: 8px;
    line-height: 1.6;
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 0.75rem !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-accent-primary);
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2.5rem;
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
}


/* ==========================================================================
   2. Glassmorphic Terminal Chatbot UI
   ========================================================================== */
#thrust-thread-chatbot-container {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 9999;
}

.chatbot-toggle {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    color: var(--color-accent-primary);
    padding: 0.9rem 1.6rem;
    border-radius: 50px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}

.chatbot-toggle:hover {
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow-hover);
    transform: scale(1.02);
}

.chatbot-toggle.hidden {
    display: none;
}

.pulse-indicator {
    position: relative;
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
}

.pulse-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid var(--color-success);
    opacity: 0.8;
    will-change: transform, opacity;
    animation: pulse-accelerated 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-accelerated {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}

.chatbot-window-box {
    display: none;
    flex-direction: column;
    width: 410px;
    height: 520px;
    background: rgba(14, 17, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.chatbot-window-box.open {
    display: flex;
}

.chatbot-header {
    background: var(--color-bg-primary);
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.console-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.console-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.console-close:hover {
    color: var(--color-error);
}

.chatbot-messages {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background-image: radial-gradient(rgba(56, 189, 248, 0.015) 1px, transparent 1px);
    background-size: 16px 16px;
}

.chat-msg {
    display: flex;
    max-width: 85%;
    animation: bubbleIn 0.3s ease;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
    align-self: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
}

.chat-msg-text {
    padding: 0.85rem 1.15rem;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-msg.bot .chat-msg-text {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    border-bottom-left-radius: 0;
    border: 1px solid var(--color-border);
}

.chat-msg.user .chat-msg-text {
    background: linear-gradient(135deg, var(--color-accent-primary) 0%, var(--color-accent-secondary) 100%);
    color: #07080c;
    border-bottom-right-radius: 0;
    font-weight: 600;
}

.chat-msg.error .chat-msg-text {
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.chatbot-form {
    border-top: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    background: var(--color-bg-primary);
    gap: 0.65rem;
}

.prompt-symbol {
    font-family: var(--font-mono);
    color: var(--color-accent-primary);
    font-weight: 700;
    font-size: 0.95rem;
}

#chatbot-input-field {
    flex-grow: 1;
    border: none;
    background: transparent;
    color: var(--color-text-primary);
    font-family: var(--font-mono);
    outline: none;
    font-size: 0.9rem;
}

.chatbot-send-btn {
    background: transparent;
    border: none;
    color: var(--color-accent-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.chatbot-send-btn:hover {
    color: var(--color-accent-secondary);
    transform: translateX(2px);
}

/* Chatbot Custom Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--color-bg-tertiary);
    border-radius: 10px;
}

/* Chat Loader Dot Animation */
.loading-dots span {
    animation: dotBlink 1.4s infinite both;
    font-weight: 800;
    font-size: 1.2rem;
    display: inline-block;
    width: 6px;
    text-align: center;
}

.loading-dots span:nth-child(2) {
    animation-delay: .2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes dotBlink {
    0% { opacity: .2; }
    20% { opacity: 1; }
    100% { opacity: .2; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wizard-container {
        padding: 2rem 1.5rem;
    }
    .wizard-progress::before {
        display: none;
    }
    .wizard-progress {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    .step-node {
        flex-direction: row;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    #thrust-thread-chatbot-container {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
    }
    .chatbot-toggle {
        border-radius: 0;
        width: 100%;
        justify-content: center;
    }
    .chatbot-window-box {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
    }
}

/* ==========================================================================
   3. Content-Editable Sandbox Editor & Terminal Layouts
   ========================================================================== */
pre .sandbox-trigger-btn {
    position: absolute;
    top: 0.5rem;
    right: 4.5rem; /* Sit adjacent to the copy button */
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    opacity: 0.4;
}

pre:hover .sandbox-trigger-btn {
    opacity: 1;
}

pre .sandbox-trigger-btn:hover, pre .sandbox-trigger-btn.active {
    border-color: var(--color-accent-primary);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-glow);
    opacity: 1;
}

pre .sandbox-trigger-btn.active {
    background: var(--color-bg-tertiary);
}

pre .sandbox-label-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--color-accent-secondary);
    background: rgba(129, 140, 248, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(129, 140, 248, 0.2);
}

.sandbox-terminal {
    background: #07080c;
    border: 1px solid var(--color-border-active);
    border-radius: 6px;
    margin: 1.5rem 0;
    overflow: hidden;
    font-family: var(--font-mono);
    box-shadow: var(--shadow-glow);
    animation: wizardFadeIn 0.3s ease;
}


.sandbox-terminal-header {
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sandbox-terminal-header .term-title {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}


.sandbox-terminal-header .term-btn {
    background: var(--color-accent-primary);
    color: #07080c;
    border: none;
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sandbox-terminal-header .term-btn:hover {
    box-shadow: var(--shadow-glow-hover);
    transform: translateY(-1px);
}

.sandbox-terminal-header .term-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sandbox-terminal-output {
    padding: 1.25rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #cbd5e1;
    min-height: 100px;
    max-height: 250px;
    overflow-y: auto;
    background: #07080c;
}


.sandbox-terminal-output .log-line {
    margin-bottom: 0.4rem;
}

.sandbox-terminal-output .log-line.system {
    color: var(--color-accent-secondary);
}

.sandbox-terminal-output .log-line.success {
    color: var(--color-success);
    font-weight: 600;
}

/* Persistent Bottom Console Bar Styling */
#footer-console-bar input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
}

#global-cli-overlay {
    transition: var(--transition-smooth);
}

#global-cli-overlay-close:hover {
    color: var(--color-error) !important;
}

.system-status-readout span {
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

/* ==========================================================================
   4. Systems Hardware Protocol Simulator Styles
   ========================================================================== */
.simulator-dashboard-container {
    animation: wizardFadeIn 0.5s ease;
}

.sim-tab-btn {
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sim-tab-btn:hover {
    color: var(--color-accent-primary) !important;
    background: rgba(56, 189, 248, 0.03) !important;
    border-color: rgba(56, 189, 248, 0.1) !important;
}

.sim-tab-btn.active {
    background: rgba(56, 189, 248, 0.08) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    color: var(--color-accent-primary) !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.1);
}

/* SCL and SDA Waveform Pulse styles */
.waveform-pulse-line {
    stroke-dasharray: 8 4;
    animation: waveform-dash-pulse 10s linear infinite;
}

@keyframes waveform-dash-pulse {
    to {
        stroke-dashoffset: -120;
    }
}

/* Dynamic sweep visual scanner */
.wave-sweep-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.wave-sweep-line {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 96%, var(--color-accent-primary) 98%, transparent 100%);
    opacity: 0.7;
    will-change: transform;
    animation: wave-sweep 4s linear infinite;
}

@keyframes wave-sweep {
    0% { transform: translate3d(-100%, 0, 0); }
    100% { transform: translate3d(0%, 0, 0); }
}

.waveform-diagram-box path {
    filter: drop-shadow(0 0 2px var(--color-accent-primary));
    transition: stroke-dasharray 0.3s ease, d 0.5s ease;
}

/* Proactive Chatbot Speech Tooltip Bubble */
.chatbot-bubble-box {
    position: absolute;
    bottom: 5rem;
    right: 0;
    width: 290px;
    background: rgba(14, 17, 26, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.85rem 2.25rem 0.85rem 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    line-height: 1.5;
    z-index: 10000;
    animation: bubbleSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.bubble-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.bubble-close:hover {
    color: var(--color-error);
}

@keyframes bubbleSlideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

