/* Apex Compliance Assistant - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #06060c;
    --bg-secondary: #0e1018;
    --bg-tertiary: #161a24;
    --bg-elevated: #1e222e;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text: #f0f2f5;
    --text-secondary: #8b919a;
    --text-dim: #505560;
    --accent: #e3a008;
    --accent-hover: #f0b429;
    --accent-glow: rgba(227, 160, 8, 0.15);
    --accent-soft: rgba(227, 160, 8, 0.06);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.12);
    --warning: #d29922;
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --info: #60a5fa;
    --console-bg: #06060c;
    --console-text: #e6edf3;
    --console-accent: #79c0ff;
    --console-success: #56d364;
    --console-warning: #e3b341;
    --console-request: #a5d6ff;
    --console-response: #7ee787;
}

html {
    height: 100%;
    background: var(--bg-primary);
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: transparent;
    color: var(--text);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ===== Ambient Background ===== */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-animation::before {
    content: '';
    position: absolute;
    width: 700px;
    height: 500px;
    border-radius: 50%;
    background: rgba(227, 160, 8, 0.06);
    top: -15%;
    left: -5%;
    filter: blur(120px);
    opacity: 0;
    animation: glow-in 2s ease-out 0.2s forwards;
}

.bg-animation::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 400px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.03);
    bottom: -10%;
    right: -5%;
    filter: blur(120px);
    opacity: 0;
    animation: glow-in 2s ease-out 0.5s forwards;
}

@keyframes glow-in {
    to { opacity: 1; }
}

/* Top accent line */
.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 10%,
        rgba(227, 160, 8, 0.3) 30%,
        rgba(227, 160, 8, 0.5) 50%,
        rgba(227, 160, 8, 0.3) 70%,
        transparent 90%
    );
}

/* Noise texture */
.bg-grid::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    pointer-events: none;
}

.bg-orb-3 {
    display: none;
}

/* ===== Header ===== */
.header {
    background: rgba(14, 16, 24, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 15%,
        rgba(227, 160, 8, 0.3) 50%,
        transparent 85%
    );
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(145deg, var(--accent), #b07d06);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(227, 160, 8, 0.2);
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.logo-text .title-accent {
    background: linear-gradient(135deg, var(--accent), #f0b429);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.subtitle-icon {
    display: flex;
    align-items: center;
    width: 12px;
    height: 12px;
    opacity: 0.5;
}

.subtitle-icon svg {
    width: 12px;
    height: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

/* Header Buttons */
.header-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    color: var(--text);
}

.header-btn.console-toggle.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.header-btn svg {
    width: 15px;
    height: 15px;
    opacity: 0.7;
}

.header-btn:hover svg {
    opacity: 1;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem 0.375rem 0.625rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: all 0.3s ease;
}

.connection-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: all 0.3s ease;
}

.connection-status.connected {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.connection-status.connected .status-dot {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.connection-status.error {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.connection-status.error .status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ===== Tab Bar ===== */
.tab-bar {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    flex-shrink: 0;
    gap: 0.25rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== Main Layout ===== */
.main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.sidebar-header {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header h2::before {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--accent);
}

.sidebar-header p {
    font-size: 0.8125rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Quick Questions List */
.questions-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.875rem;
}

.question-category {
    margin-bottom: 1rem;
}

.question-category h3 {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.question-category h3 .cat-icon {
    font-size: 0.8125rem;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.suggestion-btn:hover {
    background: var(--accent-soft);
    border-color: rgba(227, 160, 8, 0.15);
    color: var(--text);
}

.suggestion-btn .btn-icon {
    font-size: 0.875rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.suggestion-btn:hover .btn-icon {
    opacity: 0.9;
}

.suggestion-btn .btn-text {
    flex: 1;
    line-height: 1.3;
}

/* ===== Chat Area ===== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    position: relative;
}

/* Searching state - subtle spinner */
.chat-area::after {
    content: '';
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(227, 160, 8, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.chat-area.searching::after {
    opacity: 1;
    animation: spin 1s linear infinite;
}

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

/* Messages */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.message-avatar.assistant {
    background: linear-gradient(135deg, var(--accent), #b07d06);
}

.message-avatar.user {
    background: var(--bg-tertiary);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.message-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
}

.message-text p { margin-bottom: 0.75rem; }
.message-text p:last-child { margin-bottom: 0; }

.message-text ul, .message-text ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.message-text li { margin-bottom: 0.375rem; }

.message-text code {
    background: var(--bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
    color: #f472b6;
    border: 1px solid rgba(244, 114, 182, 0.15);
}

.message-text strong {
    color: var(--accent);
    font-weight: 600;
}

/* Message Cards */
.message-card {
    max-width: 700px;
    margin: 0 auto 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    animation: fade-up 0.35s ease-out forwards;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-card.assistant {
    border-color: rgba(227, 160, 8, 0.12);
}

.message-card.user {
    background: var(--bg-primary);
}

.message-card-header {
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.message-card.assistant .message-card-header {
    background: rgba(227, 160, 8, 0.04);
    border-bottom-color: rgba(227, 160, 8, 0.08);
}

.message-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.message-card.assistant .message-card-title {
    color: var(--accent);
}

.message-card-icon {
    font-size: 0.9375rem;
}

.copy-btn {
    padding: 0.375rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--bg-primary);
    border-color: var(--border);
    color: var(--text-secondary);
}

.copy-btn.copied {
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.06);
}

.message-card-body {
    padding: 1.125rem 1.25rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
}

.message-card-body p { margin-bottom: 0.875rem; }
.message-card-body p:last-child { margin-bottom: 0; }

.message-card-body ul, .message-card-body ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.message-card-body li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
    color: var(--text-secondary);
}

.message-card-body li::marker {
    color: var(--accent);
}

.message-card-body h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.125rem 0 0.5rem 0;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border);
}

.message-card-body h2:first-child { margin-top: 0; }

.message-card-body h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0.875rem 0 0.375rem 0;
}

.message-card-body h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin: 0.75rem 0 0.25rem 0;
}

.message-card-body strong {
    color: var(--accent);
    font-weight: 600;
}

.message-card-body code {
    background: var(--bg-primary);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
    color: #f472b6;
    border: 1px solid rgba(244, 114, 182, 0.15);
}

.message-card-body .md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.message-card-body .md-table th,
.message-card-body .md-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.message-card-body .md-table th {
    background: var(--bg-primary);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.message-card-body .md-table td { color: var(--text); }

.message-card-body .md-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

.message-card-body .md-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Q&A Card Interface ===== */
.qa-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.qa-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    animation: fade-up 0.5s ease-out 0.1s forwards;
}

.qa-card-header {
    padding: 1.125rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.qa-card-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent), #b07d06);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(227, 160, 8, 0.15);
}

.qa-card-icon svg {
    color: white;
}

.qa-card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.qa-card-header p {
    font-size: 0.8125rem;
    color: var(--text-dim);
}

.qa-card-body {
    padding: 1.25rem;
}

.qa-input-section {
    margin-bottom: 1rem;
}

.qa-input-section label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.qa-textarea {
    width: 100%;
    min-height: 90px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.qa-textarea:focus {
    outline: none;
    border-color: rgba(227, 160, 8, 0.4);
    box-shadow: 0 0 0 3px rgba(227, 160, 8, 0.06);
}

.qa-textarea::placeholder { color: var(--text-dim); }

.qa-submit-btn {
    margin-top: 0.875rem;
    padding: 0.75rem 1.75rem;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: #000;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.qa-submit-btn:hover { background: var(--accent-hover); }
.qa-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.qa-submit-btn:active:not(:disabled) { transform: scale(0.98); }

.qa-suggestions {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.qa-suggestions-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 0.625rem;
}

.qa-suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.qa-chip {
    padding: 0.375rem 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.qa-chip:hover {
    background: var(--accent-soft);
    border-color: rgba(227, 160, 8, 0.25);
    color: var(--accent);
}

/* Q&A Input Bar */
.qa-input-bar {
    display: none;
    padding: 0.875rem 1.25rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.qa-input-bar.visible { display: block; }

.qa-input-bar-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    gap: 0.625rem;
    align-items: flex-end;
}

.qa-bar-textarea {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.9375rem;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.2s ease;
}

.qa-bar-textarea:focus {
    outline: none;
    border-color: rgba(227, 160, 8, 0.4);
}

.qa-bar-textarea::placeholder { color: var(--text-dim); }

.qa-bar-btn {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: #000;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qa-bar-btn:hover { background: var(--accent-hover); }
.qa-bar-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Evaluate Mode ===== */
.evaluate-area {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.evaluate-area.active { display: flex; }

.evaluate-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.transcript-input-section {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.transcript-input-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.transcript-input-section p {
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.transcript-textarea {
    width: 100%;
    min-height: 280px;
    max-height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.transcript-textarea:focus {
    outline: none;
    border-color: rgba(227, 160, 8, 0.4);
    box-shadow: 0 0 0 3px rgba(227, 160, 8, 0.06);
}

.transcript-textarea::placeholder { color: var(--text-dim); }

.evaluate-btn {
    margin-top: 0.875rem;
    padding: 0.75rem 1.75rem;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: #000;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.evaluate-btn:hover { background: var(--accent-hover); }
.evaluate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.evaluate-btn:active:not(:disabled) { transform: scale(0.98); }

/* ===== Results Card ===== */
.results-card {
    max-width: 800px;
    margin: 1.5rem auto 0;
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    animation: fade-up 0.4s ease-out forwards;
}

.results-card.glow-success {
    border-color: rgba(34, 197, 94, 0.2);
}

.results-card.glow-warning {
    border-color: rgba(227, 160, 8, 0.2);
}

.results-card.glow-danger {
    border-color: rgba(239, 68, 68, 0.2);
}

.results-header {
    padding: 0.875rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.results-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-header-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.results-header-actions .copy-btn {
    padding: 0.375rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.results-header-actions .copy-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border-hover);
}

.results-header-actions .copy-btn.copied {
    color: var(--success);
    border-color: var(--success);
}

.results-body {
    padding: 1.125rem 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.7;
}

.results-body h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.25rem 0 0.625rem 0;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border);
}

.results-body h2:first-child { margin-top: 0; }

.results-body h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
    margin: 1rem 0 0.375rem 0;
}

.results-body h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin: 0.875rem 0 0.25rem 0;
}

.results-body p {
    margin-bottom: 0.625rem;
    color: var(--text);
}

.results-body ul, .results-body ol {
    margin: 0.5rem 0 0.875rem 0;
    padding-left: 1.25rem;
}

.results-body li {
    margin-bottom: 0.375rem;
    color: var(--text-secondary);
}

.results-body strong {
    color: #fbbf24;
    font-weight: 700;
}

.results-body code {
    background: var(--bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: #f472b6;
    border: 1px solid rgba(244, 114, 182, 0.15);
}

.results-body .md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.results-body .md-table th,
.results-body .md-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.results-body .md-table th {
    background: var(--bg-tertiary);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.results-body .md-table td { color: var(--text); }

.results-body .md-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

.results-body .md-table tbody tr:last-child td {
    border-bottom: none;
}

.results-footer {
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-dim);
}

.severity-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.severity-badge.high {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.severity-badge.medium {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.severity-badge.low {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
}

/* Sample Transcripts Sidebar */
.sample-transcripts { display: none; }

.sample-transcripts.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.sample-category {
    margin-bottom: 1rem;
}

.sample-category h3 {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Mode switching */
body.evaluate-mode .qa-content { display: none !important; }
body.evaluate-mode .evaluate-area { display: flex !important; }
body.evaluate-mode .sample-transcripts { display: flex !important; }
body.evaluate-mode .qa-sidebar { display: none !important; }

/* ===== Loading ===== */
.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    font-size: 0.875rem;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Search Status */
.search-status { margin-top: 0.75rem; }

.search-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-dim);
    padding: 0.25rem 0;
    opacity: 0;
    animation: fade-up 0.25s ease-out forwards;
}

.search-item .search-icon {
    width: 14px;
    height: 14px;
    color: var(--accent);
    opacity: 0.7;
}

.search-item.complete .search-icon {
    color: var(--success);
    opacity: 1;
}

.search-query {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Console Panel ===== */
.console-panel {
    width: 0;
    background: var(--console-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

.console-panel.open { width: 400px; }

.console-header {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.console-header h3 {
    color: var(--console-text);
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.console-header h3 svg { color: var(--console-accent); }

.console-clear-btn {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.6875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.console-clear-btn:hover {
    background: var(--bg-tertiary);
    color: var(--console-text);
}

.console-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    line-height: 1.6;
}

.console-entry {
    margin-bottom: 0.875rem;
    opacity: 0;
    animation: fade-up 0.25s ease-out forwards;
}

.console-entry-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.console-badge {
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.console-badge.request {
    background: rgba(129, 140, 248, 0.15);
    color: var(--console-request);
}

.console-badge.response {
    background: rgba(52, 211, 153, 0.15);
    color: var(--console-response);
}

.console-badge.tool {
    background: rgba(251, 191, 36, 0.15);
    color: var(--console-warning);
}

.console-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.console-timestamp {
    color: var(--text-dim);
    font-size: 0.625rem;
}

.console-json {
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 0.625rem;
    overflow-x: auto;
    color: var(--text-dim);
}

.console-json .key { color: var(--console-accent); }
.console-json .string { color: #a5f3fc; }
.console-json .number { color: #fcd34d; }
.console-json .boolean { color: #f472b6; }
.console-json .null { color: var(--text-dim); }

.console-tool-info {
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.12);
    border-radius: 4px;
    padding: 0.5rem 0.625rem;
    color: #fcd34d;
}

.console-tool-info .tool-name {
    font-weight: 600;
    color: var(--console-warning);
}

.console-tool-info .tool-query {
    color: #fef3c7;
    margin-top: 0.125rem;
}

.console-stats {
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1.25rem;
    flex-shrink: 0;
}

.console-stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.console-stat-label {
    font-size: 0.625rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.console-stat-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--console-text);
    font-family: 'JetBrains Mono', monospace;
}

.console-stat-value.success { color: var(--console-success); }

/* ===== Analysis Progress ===== */
.analysis-progress {
    max-width: 800px;
    margin: 1.5rem auto 0;
    width: 100%;
}

.progress-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.progress-header {
    padding: 0.875rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.progress-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
}

.progress-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(227, 160, 8, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-body {
    padding: 1.25rem;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-primary);
    border-radius: 8px;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.4s ease;
}

.progress-step[data-step="1"] {
    opacity: 1;
    transform: translateY(0);
}

.progress-step.visible {
    opacity: 1;
    transform: translateY(0);
}

.progress-step.complete { opacity: 0.6; }

.step-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.step-icon svg {
    width: 14px;
    height: 14px;
}

.progress-step.active .step-icon {
    border-color: var(--accent);
    background: rgba(227, 160, 8, 0.1);
}

.progress-step.complete .step-icon {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.step-content { flex: 1; }

.step-title {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.step-subtitle, .step-desc {
    font-size: 0.6875rem;
    color: var(--text-dim);
    margin-top: 0.125rem;
}

.step-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.step-status.active {
    border-color: var(--accent);
    background: rgba(227, 160, 8, 0.1);
}

.step-status.active::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.step-status.complete {
    border-color: var(--success);
    background: var(--success);
}

.step-status.complete::after {
    content: '\2713';
    font-size: 0.625rem;
    font-weight: 700;
    color: white;
}

/* Scan line */
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: scanDown 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
    opacity: 0.5;
}

@keyframes scanDown {
    0% { top: 0; opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { top: 100%; opacity: 0; }
}

/* No issues */
.no-issues {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 500;
}

/* ===== Demo Footer & Tour ===== */
.demo-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    opacity: 0.4;
    z-index: 100;
    cursor: default;
    user-select: none;
}

.demo-footer:hover { opacity: 0.7; }

.demo-indicator {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #000;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(227, 160, 8, 0.2);
    opacity: 0;
    animation: fade-up 0.3s ease-out forwards;
}

.demo-indicator .pulse-dot {
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
}

.demo-indicator button {
    background: rgba(0, 0, 0, 0.15);
    border: none;
    color: #000;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    margin-left: 4px;
}

.demo-indicator button:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .console-panel.open { width: 340px; }
}

@media (max-width: 1024px) {
    .sidebar { width: 250px; }
    .qa-card, .results-card, .transcript-input-section { max-width: 100%; }
}

@media (max-width: 900px) {
    .sidebar { display: none; }
    .console-panel { display: none; }

    .header { padding: 0.625rem 1rem; }
    .logo-subtitle { display: none; }
    .logo-text h1 { font-size: 1.125rem; }
    .header-btn span { display: none; }
    .header-btn { padding: 0.4rem 0.5rem; }

    .tab-bar { padding: 0 1rem; }
    .tab-btn { padding: 0.75rem 1rem; font-size: 0.875rem; }
}

@media (max-width: 640px) {
    .header { padding: 0.5rem 0.75rem; }
    .header-left { gap: 0.5rem; }

    .logo-icon { width: 36px; height: 36px; }
    .logo-icon svg { width: 18px; height: 18px; }
    .logo-text h1 { font-size: 1rem; }
    .logo-text .title-accent { display: none; }

    .header-actions { gap: 0.375rem; }
    .connection-status { padding: 0.25rem 0.5rem; }
    .connection-status .status-label { display: none; }

    .tab-bar { padding: 0 0.75rem; gap: 0; }
    .tab-btn {
        flex: 1;
        padding: 0.625rem 0.375rem;
        font-size: 0.8125rem;
        justify-content: center;
    }
    .tab-btn svg { width: 16px; height: 16px; }

    .qa-scroll-area { padding: 1rem; }
    .qa-card-header { padding: 0.875rem 1rem; }
    .qa-card-header h2 { font-size: 1rem; }
    .qa-card-header p { font-size: 0.75rem; }
    .qa-card-icon { width: 38px; height: 38px; }
    .qa-card-body { padding: 1rem; }
    .qa-textarea { min-height: 80px; font-size: 0.875rem; }
    .qa-submit-btn { width: 100%; justify-content: center; padding: 0.625rem 1rem; }
    .qa-suggestion-chips { flex-direction: column; }
    .qa-chip { text-align: center; }

    .evaluate-content { padding: 1rem; }
    .transcript-input-section h2 { font-size: 1rem; }
    .transcript-input-section p { font-size: 0.8125rem; }
    .transcript-textarea { min-height: 200px; font-size: 0.75rem; }
    .evaluate-btn { width: 100%; justify-content: center; }
    .results-card { margin-top: 1rem; }
    .results-header { padding: 0.75rem 1rem; }
    .results-body { padding: 1rem; font-size: 0.875rem; }

    .qa-input-bar { padding: 0.75rem; }
    .qa-bar-textarea { font-size: 0.875rem; }
    .message-card { max-width: 100%; }
    .message-card-body { padding: 1rem; font-size: 0.9375rem; }

    .connection-status span:last-child { display: none; }

    .progress-body { padding: 0.875rem; }
    .progress-step { padding: 0.5rem 0.625rem; }
    .step-icon { width: 26px; height: 26px; }
    .step-icon svg { width: 12px; height: 12px; }
    .step-title { font-size: 0.8125rem; }
}
