/* x402 Stream Terminal UI - Pure Black Minimal Design */

:root {
    --bg-black: #000000;
    --text-primary: #EEEEEE;
    --text-secondary: #999999;
    --accent-cyan: #00D1FF;
    --border-gray: #333333;
    --selection-bg: #00D1FF;
    --selection-text: #000000;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-black);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'Courier New', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
}

/* Noise grain overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/noise.png');
    background-repeat: repeat;
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

/* Text selection styling */
::selection {
    background-color: var(--selection-bg);
    color: var(--selection-text);
}

/* Terminal container - centered viewport */
.terminal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2;
}

/* Terminal window */
.terminal {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background-color: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

/* Terminal header with dots */
.terminal-header {
    background-color: rgba(20, 20, 20, 0.95);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.red { background-color: #FF5F56; }
.dot.yellow { background-color: #FFBD2E; }
.dot.green { background-color: #27C93F; }

.terminal-title {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

/* Terminal body - scrollable content area */
.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 14px;
}

/* Custom scrollbar */
.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Output lines */
#output {
    margin-bottom: 8px;
}

.output-line {
    margin-bottom: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-line.command {
    color: var(--text-primary);
}

.output-line.result {
    color: var(--text-secondary);
    margin-left: 0;
}

.output-line.arrow {
    color: var(--accent-cyan);
    margin-left: 0;
}

.output-line.json {
    color: #88C0D0;
    font-size: 13px;
    margin-left: 0;
}

.output-line.success {
    color: #A3BE8C;
}

.output-line.info {
    color: #81A1C1;
}

.output-line.error {
    color: #BF616A;
}

/* Input line with prompt */
.input-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.prompt {
    color: var(--accent-cyan);
    font-weight: 600;
    margin-right: 4px;
}

.input-text {
    color: var(--text-primary);
    white-space: pre;
}

/* Blinking cursor */
.cursor {
    color: var(--accent-cyan);
    animation: blink 650ms infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Hidden input field */
#hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    left: -9999px;
}

/* Typing animation for intro */
.typing {
    overflow: hidden;
    border-right: 2px solid var(--accent-cyan);
    white-space: nowrap;
    animation: typing 0.05s steps(1, end);
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* Status table styling */
.status-table {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px 20px;
    margin: 8px 0;
    color: var(--text-secondary);
}

.status-key {
    color: var(--text-primary);
}

.status-value {
    color: #A3BE8C;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .cursor {
        animation: none;
        opacity: 1;
    }
    
    .typing {
        animation: none;
        border-right: none;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }
    
    .terminal-container {
        padding: 10px;
    }
    
    .terminal {
        max-height: 95vh;
        border-radius: 6px;
    }
    
    .terminal-header {
        padding: 10px 12px;
    }
    
    .terminal-body {
        padding: 15px;
        font-size: 13px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 12px;
    }
    
    .terminal-container {
        padding: 5px;
    }
    
    .terminal-body {
        padding: 12px;
        font-size: 12px;
    }
    
    .terminal-title {
        font-size: 11px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .terminal {
        border-color: var(--text-primary);
    }
    
    .terminal-header {
        border-bottom-color: var(--text-primary);
    }
}
