/* KLARA Terminal Theme - Enterprise Grade */
:root {
    --klara-navy: #0f172a;
    --klara-blue: #3b82f6;
    --klara-green: #10b981;
    --klara-red: #ef4444;
    --klara-teal: #14b8a6;
    --klara-purple: #8b5cf6;
    
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2), 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    
    --terminal-bg: #1a1a2e;
    --terminal-fg: #e0e0e0;
    --terminal-green: #38a169;
    --terminal-red: #e53e3e;
    --terminal-blue: #3182ce;
    --terminal-yellow: #d69e2e;
    --terminal-teal: #38b2ac;
}

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

body {
    background-color: #0f172a;
    color: var(--terminal-fg);
    font-family: 'Fira Code', 'Consolas', monospace;
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
}

/* Subtle circuit overlay - very faint */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/circuit-pattern-2.svg');
    background-size: 1600px 1200px;
    background-position: center top;
    background-attachment: fixed;
    opacity: 0.06;
    pointer-events: none;
    z-index: -1;
}

.demo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Brand logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo-icon {
    font-size: 2.5rem;
}

.logo-text {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header */
.demo-header {
    text-align: center;
    margin-bottom: 2rem;
}

.demo-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--terminal-fg);
}

.demo-subtitle {
    color: #a0aec0;
    font-size: 1.1rem;
}

/* Performance badges */
.performance-badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.badge {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: help;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.badge-icon {
    font-size: 1.2rem;
}

/* Tooltip styling */
.tooltip-icon {
    cursor: help;
    color: var(--klara-blue);
    font-size: 0.9rem;
    margin-left: 0.25rem;
    position: relative;
}

.tooltip-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    z-index: 100;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Enhanced footer */
.demo-footer {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid #334155;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links {
    color: #94a3b8;
}

.footer-links a {
    color: var(--klara-blue);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.trust-signals {
    color: #64748b;
    font-size: 0.9rem;
}

/* Terminal Window */
.terminal-window {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    min-height: 400px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    padding-top: 2.5rem;
}

/* macOS window controls */
.terminal-window::before {
    content: '● ●●';
    position: absolute;
    top: 12px;
    left: 16px;
    color: #475569;
    font-size: 16px;
    letter-spacing: -2px;
    z-index: 10;
}

.terminal-output {
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.terminal-input-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: var(--terminal-green);
    margin-right: 0.5rem;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--terminal-fg);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.quote-mark {
    color: var(--terminal-fg);
}

/* Color-coded output classes */
.output-success {
    color: var(--terminal-green);
}

.output-danger {
    color: var(--terminal-red);
}

.output-info {
    color: var(--terminal-blue);
}

.output-warning {
    color: var(--terminal-yellow);
}

.normal {
    color: var(--terminal-fg);
}

/* Controls */
.demo-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.scenario-dropdown {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background-color: #2d3748;
    color: var(--terminal-fg);
    border: 1px solid #4a5568;
    font-family: inherit;
    min-width: 280px;
    cursor: pointer;
    font-size: 14px;
}

.scenario-dropdown:focus {
    outline: 2px solid var(--terminal-blue);
    border-color: var(--terminal-blue);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    border: none;
}

.btn-primary {
    background-color: var(--terminal-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #2b6cb0;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #4a5568;
    color: white;
}

.btn-secondary:hover {
    background-color: #2d3748;
    transform: translateY(-1px);
}

/* Metrics Dashboard */
.metrics-dashboard {
    background-color: #2d3748;
    border-radius: 8px;
    padding: 1rem;
}

.metrics-dashboard h3 {
    margin-bottom: 0.75rem;
    color: var(--terminal-fg);
    font-size: 1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.metric-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card.compact {
    padding: 0.5rem;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.metric-card {
    animation: slideIn 0.4s ease-out;
}

.metric-card:nth-child(2) { animation-delay: 0.05s; }
.metric-card:nth-child(3) { animation-delay: 0.1s; }
.metric-card:nth-child(4) { animation-delay: 0.15s; }

.metric-title {
    font-size: 0.7rem;
    color: #a0aec0;
    margin-bottom: 0.3rem;
}

/* Confidence Meter */
.meter {
    height: 14px;
    background-color: #2d3748;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.meter-fill {
    background: var(--gradient-accent);
    border-radius: 3px;
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    display: block;
}

.meter-fill.critical {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.meter-fill.warning {
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.4);
}

.meter-fill.low {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.metric-value {
    font-size: 1.3rem;
    font-weight: bold;
}

/* Capability Status */
.capability-status {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    font-size: 1.3rem;
}

.status-allowed {
    background-color: var(--terminal-green);
    color: white;
}

.status-denied {
    background-color: var(--terminal-red);
    color: white;
}

.status-pending {
    background-color: #4a5568;
    color: #a0aec0;
}

/* Escalation Level */
.escalation-level {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    font-size: 1.3rem;
}

.level-none {
    background-color: var(--terminal-green);
    color: white;
}

.level-warning {
    background-color: var(--terminal-yellow);
    color: #1a202c;
}

.level-critical {
    background-color: var(--terminal-red);
    color: white;
}

/* Processing Time */
.processing-time {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--terminal-blue);
}

/* Footer */
.demo-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #4a5568;
    text-align: center;
    color: #a0aec0;
}

.demo-footer a {
    color: var(--terminal-blue);
    text-decoration: none;
}

.demo-footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .demo-container {
        padding: 1rem;
    }

    .brand-logo {
        flex-direction: column;
        gap: 0.5rem;
    }

    .logo-icon {
        font-size: 2rem;
    }

    .logo-text {
        font-size: 2.5rem;
    }

    .demo-header h1 {
        font-size: 1.8rem;
    }

    .demo-subtitle {
        font-size: 1rem;
    }

    .terminal-window {
        padding: 1rem;
        font-size: 12px;
    }

    .terminal-input {
        font-size: 12px;
    }

    .demo-controls {
        flex-direction: column;
    }

    .scenario-dropdown, .btn {
        width: 100%;
    }

    .performance-badges {
        flex-direction: column;
    }

    .badge {
        width: 100%;
        justify-content: center;
    }

    .metric-card {
        padding: 0.75rem;
    }

    .metric-value, .processing-time {
        font-size: 1.2rem;
    }
}

/* Animation for new output lines */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.terminal-output div {
    animation: fadeIn 0.2s ease;
}

/* Blinking cursor effect for input */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.terminal-input:focus {
    animation: blink 1s infinite;
}

/* Loading/processing state */
.processing {
    opacity: 0.6;
    pointer-events: none;
}

/* Progress indicator */
.evaluation-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--klara-blue);
    font-size: 0.9rem;
    margin: 1rem 0;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--klara-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Copy results button */
.copy-results-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--klara-blue);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: inherit;
    cursor: pointer;
    margin: 1rem 0;
    transition: all 0.2s ease;
}

.copy-results-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a202c;
}

::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #718096;
}
