/**
 * Transcript Sub-Tab Styles - ITERATION A-344
 * Linear execution narrative view
 */

/* ================================================================
   CONTAINER & LAYOUT
   ================================================================ */

.transcript-container {
    height: 100%;
    overflow: hidden;
    background: #0d1117;
    font-size: 16px; /* A-340: Larger base font for demos */
}

.transcript-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ================================================================
   HEADER
   ================================================================ */

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, #161b22 0%, #0d1117 100%);
    border-bottom: 1px solid #21262d;
    flex-shrink: 0;
}

.transcript-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #e6edf3;
}

.transcript-icon {
    font-size: 18px;
}

.transcript-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.transcript-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8b949e;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.transcript-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e6edf3;
    border-color: rgba(255, 255, 255, 0.2);
}

.transcript-auto-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #8b949e;
    cursor: pointer;
}

.transcript-auto-scroll input {
    cursor: pointer;
}

/* ================================================================
   CONTENT AREA
   ================================================================ */

.transcript-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
}

/* Scrollbar styling */
.transcript-content::-webkit-scrollbar {
    width: 8px;
}

.transcript-content::-webkit-scrollbar-track {
    background: #0d1117;
}

.transcript-content::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */

.transcript-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: #8b949e;
    text-align: center;
}

.transcript-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.transcript-empty p {
    margin: 4px 0;
}

.transcript-empty .empty-hint {
    font-size: 12px;
    opacity: 0.7;
}

/* ================================================================
   ENTRY BASE STYLES
   ================================================================ */

.transcript-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-left: 3px solid #30363d;
    transition: all 0.2s;
}

.transcript-entry:hover {
    background: rgba(255, 255, 255, 0.04);
}

.entry-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.entry-body {
    flex: 1;
    min-width: 0;
}

.entry-status {
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    font-size: 16px;
}

/* Status colors */
.entry-status.status-running {
    color: #f0ad4e;
}

.entry-status.status-completed {
    color: #3fb950;
}

.entry-status.status-failed,
.entry-status.status-error {
    color: #f85149;
}

.entry-status.status-pending,
.entry-status.status-queued {
    color: #8b949e;
}

/* Spinner animation */
.entry-status .spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ================================================================
   ENTRY TYPE: COMMENT
   ================================================================ */

.comment-entry {
    border-left-color: #58a6ff;
}

.comment-entry .entry-content {
    font-size: 16px;
    line-height: 1.7;
    color: #e6edf3;
    white-space: pre-wrap;
}

/* ================================================================
   ENTRY TYPE: ASSIGNMENT
   ================================================================ */

.assignment-entry {
    border-left-color: #a371f7;
}

.assignment-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 15px;
}

.var-name {
    color: #a371f7;
    font-weight: 500;
}

.assign-arrow {
    color: #8b949e;
}

.var-value {
    color: #7ee787;
    background: rgba(126, 231, 135, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ================================================================
   ENTRY TYPE: DECISION/GATE
   ================================================================ */

.decision-entry {
    border-left-color: #f0ad4e;
}

.entry-label {
    font-size: 14px;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.entry-prompt {
    font-size: 14px;
    color: #8b949e;
    font-style: italic;
    margin-bottom: 8px;
    padding-left: 12px;
    border-left: 2px solid #30363d;
}

.entry-result {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.result-arrow {
    color: #8b949e;
}

.result-value {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.result-value.true {
    color: #3fb950;
    background: rgba(63, 185, 80, 0.15);
}

.result-value.false {
    color: #f85149;
    background: rgba(248, 81, 73, 0.15);
}

.result-value.route {
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.15);
}

/* ================================================================
   ENTRY TYPE: ROUTER
   ================================================================ */

.router-entry {
    border-left-color: #3fb950;
}

/* ================================================================
   ENTRY TYPE: MODEL/CONTENT
   ================================================================ */

.model-entry {
    border-left-color: #f778ba;
}

.entry-preview {
    font-size: 13px;
    color: #8b949e;
    margin: 8px 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.entry-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, rgba(13, 17, 23, 0.9));
}

.entry-expand-btn {
    background: rgba(247, 120, 186, 0.1);
    border: 1px solid rgba(247, 120, 186, 0.3);
    color: #f778ba;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.entry-expand-btn:hover {
    background: rgba(247, 120, 186, 0.2);
    border-color: rgba(247, 120, 186, 0.5);
}

/* ================================================================
   ENTRY TYPE: IF/ELSE
   ================================================================ */

.ifelse-entry {
    border-left-color: #79c0ff;
}

.result-value.true {
    color: #3fb950;
}

.result-value.false {
    color: #f0ad4e;
}

/* ================================================================
   ENTRY TYPE: HUMAN INPUT
   ================================================================ */

.human-entry {
    border-left-color: #f778ba;
}

/* ================================================================
   ENTRY TYPE: HUMAN DECISION
   ================================================================ */

.human-decision-entry {
    border-left-color: #a371f7;
}

.human-decision-entry .entry-question {
    font-size: 15px;
    color: #e6edf3;
    margin: 8px 0;
    padding: 10px 14px;
    background: rgba(163, 113, 247, 0.08);
    border-radius: 6px;
    border-left: 3px solid rgba(163, 113, 247, 0.4);
    line-height: 1.5;
}

.entry-question {
    font-size: 15px;
    color: #e6edf3;
    margin: 8px 0;
    padding: 10px 14px;
    background: rgba(247, 120, 186, 0.08);
    border-radius: 6px;
    border-left: 3px solid rgba(247, 120, 186, 0.4);
    line-height: 1.5;
}

.entry-human-response {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(63, 185, 80, 0.1);
    border-radius: 6px;
    border-left: 3px solid #3fb950;
}

.response-label {
    font-size: 12px;
    color: #3fb950;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.response-value {
    font-size: 15px;
    color: #e6edf3;
    display: block;
}

.response-value.muted {
    color: #8b949e;
    font-style: italic;
}

.entry-waiting {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(240, 173, 78, 0.1);
    border-radius: 6px;
    color: #f0ad4e;
    font-size: 14px;
}

.waiting-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ================================================================
   ENTRY TYPE: LOOP
   ================================================================ */

.loop-entry {
    border-left-color: #ffa657;
}

/* ================================================================
   ENTRY TYPE: GENERIC
   ================================================================ */

.generic-entry {
    border-left-color: #8b949e;
}

/* ================================================================
   ENTRY TYPE: SYSTEM
   ================================================================ */

.system-entry {
    justify-content: center;
    border-left: none;
    background: transparent;
    padding: 8px 16px;
}

.system-entry .entry-message {
    font-size: 12px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.system-entry.start {
    border-top: 1px dashed #30363d;
    margin-top: 16px;
    padding-top: 16px;
}

.system-entry.end {
    border-bottom: 1px dashed #30363d;
    margin-bottom: 16px;
    padding-bottom: 16px;
}

/* ================================================================
   RESOLVED VARIABLE HIGHLIGHTING
   ================================================================ */

.resolved-var {
    position: relative;
    text-decoration: underline;
    text-decoration-color: rgba(0, 212, 255, 0.6);
    text-decoration-style: wavy;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    cursor: help;
    transition: all 0.2s ease;
}

.resolved-var:hover {
    background: rgba(0, 212, 255, 0.15);
    text-decoration-color: rgba(0, 212, 255, 1);
}

/* Tooltip for resolved variable */
.resolved-var::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #a371f7;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
    border: 1px solid rgba(163, 113, 247, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 4px;
}

.resolved-var:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

/* ================================================================
   INDENTATION FOR NESTED STRUCTURES
   ================================================================ */

.transcript-entry[data-depth="1"] {
    margin-left: 20px;
}

.transcript-entry[data-depth="2"] {
    margin-left: 40px;
}

.transcript-entry[data-depth="3"] {
    margin-left: 60px;
}

.transcript-entry[data-depth="4"] {
    margin-left: 80px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 600px) {
    .transcript-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .transcript-entry {
        padding: 10px 12px;
    }
    
    .entry-icon {
        font-size: 16px;
        width: 24px;
    }
}