/* ============================================
   Interactive Terminal Styles
   ============================================ */
.terminal-window {
    width: 100%;
    max-width: 900px;
    /* Increased width for TUI */
    margin: 0 auto var(--spacing-xl);
    background: #0f111a;
    /* Darker background to match screenshot */
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    text-align: left;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

.terminal-header {
    background: #1a1b26;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #2f334d;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.close {
    background-color: #ff5f56;
}

.control.minimize {
    background-color: #ffbd2e;
}

.control.maximize {
    background-color: #27c93f;
}

.terminal-title {
    flex: 1;
    text-align: center;
    color: #a9b1d6;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 50px;
}

.terminal-body {
    padding: 0;
    /* Remove padding for full TUI */
    height: 500px;
    /* Increased height */
    color: #a9b1d6;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow: hidden;
    position: relative;
    background: #0f111a;
}

.terminal-line {
    display: flex;
    align-items: center;
    padding: 20px;
    /* Add padding back for CLI mode */
}

.prompt {
    color: #7aa2f7;
    /* Blue prompt */
    margin-right: 10px;
    font-weight: bold;
}

.typewriter {
    color: #c0caf5;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background-color: #c0caf5;
    margin-left: 5px;
    animation: blink 1s step-end infinite;
}

/* TUI Specific Styles - Replicating the Go TUI */
.tui-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 4px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tui-top-bar {
    color: #bb9af7;
    /* Purple title */
    padding: 0 8px;
    margin-bottom: 4px;
    font-weight: bold;
}

.tui-main-layout {
    display: flex;
    flex: 1;
    gap: 4px;
    overflow: hidden;
}

/* Left Sidebar */
.tui-sidebar {
    width: 300px;
    border: 1px solid #7aa2f7;
    /* Blue border */
    display: flex;
    flex-direction: column;
    padding: 8px;
}

.tui-section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: #c0caf5;
}

.tui-section-title::before,
.tui-section-title::after {
    content: '─';
    flex: 1;
    color: #565f89;
    margin: 0 8px;
}

.tui-stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.tui-stat-label {
    color: #ff007c;
    /* Pink */
}

.tui-stat-value {
    color: #c0caf5;
}

.tui-case-list {
    margin-top: 16px;
    flex: 1;
    overflow-y: auto;
}

.tui-case-item {
    margin-bottom: 12px;
    padding-left: 4px;
    border-left: 2px solid transparent;
}

.tui-case-item.active {
    border-left-color: #e0af68;
    /* Yellow active indicator */
    background: rgba(224, 175, 104, 0.1);
}

.tui-case-id {
    color: #bb9af7;
    /* Purple */
}

.tui-case-title {
    color: #c0caf5;
    font-weight: bold;
}

.tui-case-meta {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
}

.severity-medium {
    color: #e0af68;
}

/* Yellow */
.severity-high {
    color: #ff9e64;
}

/* Orange */
.severity-low {
    color: #9ece6a;
}

/* Green */

/* Right Content Area */
.tui-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Top Right: Event List */
.tui-event-list-panel {
    flex: 1;
    border: 1px solid #7aa2f7;
    display: flex;
    flex-direction: column;
}

.tui-panel-title {
    padding: 4px 8px;
    border-bottom: 1px solid #565f89;
    color: #c0caf5;
}

.tui-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.tui-table th {
    text-align: left;
    padding: 4px 8px;
    color: #bb9af7;
    /* Purple headers */
    border-bottom: 1px solid #565f89;
}

.tui-table td {
    padding: 2px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.tui-table tr:hover {
    background: #2f334d;
}

.tui-table tr.selected {
    background: #2f334d;
}

/* Bottom Right: Event Details */
.tui-details-panel {
    height: 200px;
    border: 1px solid #7aa2f7;
    padding: 8px;
    overflow-y: auto;
}

.tui-detail-row {
    display: flex;
    margin-bottom: 4px;
}

.tui-detail-key {
    color: #e0af68;
    /* Yellow keys */
    width: 100px;
    flex-shrink: 0;
}

.tui-detail-value {
    color: #c0caf5;
}

/* Footer */
.tui-footer-bar {
    margin-top: 4px;
    padding: 4px 8px;
    background: #1a1b26;
    color: #c0caf5;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #7aa2f7;
}

.tui-shortcuts span {
    color: #ff007c;
    /* Pink shortcut keys */
    font-weight: bold;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}