/* System Log CSS - Full Terminal Experience */
:root {
    --neon-cyan: #00ffff;
    --neon-pink: #ff0080;
    --neon-green: #00ff41;
    --neon-orange: #ff6b35;
    --neon-purple: #8a2be2;
    --neon-yellow: #ffff00;
    
    --dark-bg: #0a0a0a;
    --darker-bg: #000000;
    --terminal-bg: #0d1117;
    --terminal-border: #30363d;
    
    --text-primary: #00ff41;
    --text-secondary: #00ffff;
    --text-muted: #666666;
    --text-accent: #ff0080;
    
    --glow-cyan: 0 0 20px #00ffff, 0 0 40px #00ffff, 0 0 60px #00ffff;
    --glow-pink: 0 0 20px #ff0080, 0 0 40px #ff0080, 0 0 60px #ff0080;
    --glow-green: 0 0 20px #00ff41, 0 0 40px #00ff41, 0 0 60px #00ff41;
    --glow-orange: 0 0 20px #ff6b35, 0 0 40px #ff6b35, 0 0 60px #ff6b35;
    
    --font-mono: 'Share Tech Mono', monospace;
    --font-orbitron: 'Orbitron', monospace;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-mono);
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Matrix Rain Background */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.05;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 255, 65, 0.1) 50%, transparent 70%);
    animation: matrixFlow 25s linear infinite;
}

@keyframes matrixFlow {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* Cyber Grid Overlay */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridPulse 6s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.03; }
    50% { opacity: 0.1; }
}

/* Terminal Container */
.terminal-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Terminal Header */
.terminal-header {
    background: linear-gradient(135deg, var(--terminal-bg) 0%, var(--darker-bg) 100%);
    border-bottom: 1px solid var(--neon-cyan);
    box-shadow: 
        0 2px 20px rgba(0, 255, 255, 0.3),
        inset 0 1px 0 rgba(0, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.terminal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    animation: scanLine 4s linear infinite;
}

.terminal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--neon-cyan) 20%, 
        var(--neon-green) 50%, 
        var(--neon-cyan) 80%, 
        transparent 100%);
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: connectionPulse 3s ease-in-out infinite;
}

@keyframes scanLine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
    z-index: 2;
    gap: 1rem;
    min-width: 0;
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
    grid-column: 2;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.control.red { 
    background: #ff5f56; 
    box-shadow: 0 0 10px #ff5f56;
}
.control.yellow { 
    background: #ffbd2e; 
    box-shadow: 0 0 10px #ffbd2e;
}
.control.green { 
    background: #27ca3f; 
    box-shadow: 0 0 10px #27ca3f;
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-orbitron);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: var(--glow-green);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
    position: relative;
    grid-column: 1;
}

.terminal-title i {
    font-size: 1.5rem;
    color: var(--neon-orange);
    text-shadow: var(--glow-orange);
    animation: pulse 2s infinite;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    grid-column: 3;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: var(--glow-green);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.status-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-shadow: var(--glow-green);
    font-weight: 700;
}

/* Main Terminal */
.terminal-main {
    height: calc(100vh - 80px); /* Full height minus header */
    background: linear-gradient(180deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    border-left: 2px solid var(--neon-cyan);
    border-right: 2px solid var(--neon-cyan);
    border-bottom: 2px solid var(--neon-cyan);
    position: relative;
    overflow: hidden;
    margin-top: 0; /* Remove gap */
    box-shadow: 
        inset 0 0 30px rgba(0, 255, 255, 0.05),
        0 0 10px rgba(0, 255, 255, 0.05);
}

.terminal-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--neon-cyan) 20%, 
        var(--neon-green) 50%, 
        var(--neon-cyan) 80%, 
        transparent 100%);
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: connectionPulse 3s ease-in-out infinite;
}

@keyframes connectionPulse {
    0%, 100% { 
        opacity: 0.6;
        transform: scaleX(1);
    }
    50% { 
        opacity: 1;
        transform: scaleX(1.02);
    }
}

.terminal-content {
    height: calc(100vh - 80px); /* Full height minus header */
    padding: 1.5rem 2rem 2rem 2rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-y: auto;
    position: relative;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 255, 0.003) 98%);
    margin-top: 2px; /* Space for connection line */
}

.terminal-content::-webkit-scrollbar {
    width: 8px;
}

.terminal-content::-webkit-scrollbar-track {
    background: var(--terminal-bg);
}

.terminal-content::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.terminal-content::-webkit-scrollbar-thumb:hover {
    background: var(--neon-green);
    box-shadow: 0 0 15px var(--neon-green);
}

/* Log Lines */
.log-line {
    margin-bottom: 0.8rem;
    animation: typewriter 0.6s ease-in-out;
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.timestamp {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 0.8rem;
    font-weight: 400;
}

/* Different log types with different colors */
.log-system {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
}

.log-network {
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
}

.log-security {
    color: var(--neon-pink);
    text-shadow: 0 0 8px var(--neon-pink);
}

.log-data {
    color: var(--neon-orange);
    text-shadow: 0 0 8px var(--neon-orange);
}

.log-price {
    color: var(--neon-yellow);
    text-shadow: 0 0 8px var(--neon-yellow);
}

.log-market {
    color: var(--neon-purple);
    text-shadow: 0 0 8px var(--neon-purple);
}

.log-blockchain {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
}

.log-conversion {
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
}

.log-volume {
    color: var(--neon-orange);
    text-shadow: 0 0 8px var(--neon-orange);
}

.log-mining {
    color: var(--neon-pink);
    text-shadow: 0 0 8px var(--neon-pink);
}

.log-update {
    color: var(--text-secondary);
    text-shadow: 0 0 5px var(--text-secondary);
}

.log-error {
    color: #ff4444;
    text-shadow: 0 0 8px #ff4444;
    animation: errorBlink 0.5s ease-in-out;
}

@keyframes errorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Terminal Footer */
.terminal-footer {
    background: var(--terminal-bg);
    border-top: 2px solid var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    position: relative;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    font-size: 0.8rem;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-shadow: var(--glow-green);
}

.connection-dot {
    width: 8px;
    height: 8px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: var(--glow-green);
    animation: blink 1.5s infinite;
}

.log-count, .last-update {
    color: var(--text-secondary);
    text-shadow: var(--glow-cyan);
}

/* Command Line */
.command-line {
    background: var(--terminal-bg);
    border-top: 1px solid var(--terminal-border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    position: relative;
}

.prompt {
    color: var(--neon-green);
    text-shadow: var(--glow-green);
    font-weight: 700;
}

.prompt-user {
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

.prompt-symbol {
    color: var(--neon-orange);
    text-shadow: var(--glow-orange);
}

.command-input {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-height: 20px;
}

.cursor {
    color: var(--neon-green);
    text-shadow: var(--glow-green);
    animation: blink 1s infinite;
    font-weight: 700;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Command Autocomplete */
.command-autocomplete {
    position: absolute;
    top: -200px;
    left: 0;
    right: 0;
    background: var(--terminal-bg);
    border: 2px solid var(--neon-cyan);
    border-radius: 0;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    transition: top 0.3s ease-out;
}

/* Single command fall animation */
@keyframes commandFall {
    0% {
        transform: translateY(-20px);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fade out animation for disappearing items */
@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

.single-command {
    animation: commandFall 0.3s ease-out;
    background: rgba(0, 255, 65, 0.1);
    border-left: 3px solid var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.autocomplete-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--terminal-border);
    color: var(--text-primary);
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #333333;
    color: var(--text-primary);
    text-shadow: var(--glow-green);
    border-left-color: var(--neon-cyan);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-command {
    font-weight: 700;
    color: var(--neon-green);
    text-shadow: var(--glow-green);
}

.autocomplete-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 1rem;
}

/* Command History */
.command-history {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--terminal-bg);
    border: 2px solid var(--neon-green);
    border-radius: 0;
    box-shadow: var(--glow-green);
    max-height: 150px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.history-item {
    padding: 0.3rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--terminal-border);
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.history-item:hover,
.history-item.selected {
    background: #333333;
    color: var(--text-primary);
    text-shadow: var(--glow-green);
}

.history-item:last-child {
    border-bottom: none;
}

/* Animations */
@keyframes typewriter {
    from { 
        opacity: 0; 
        transform: translateX(-30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Glitch effects */
.glitch {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .terminal-content {
        padding: 1rem;
    }
    
    .footer-content {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .command-line {
        padding: 1rem;
    }
    
    .terminal-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .log-line {
        font-size: 0.8rem;
    }
    
    .timestamp {
        font-size: 0.7rem;
    }
    
    .terminal-content {
        padding: 0.8rem;
    }
}

/* QR Code Container */
.qr-code-container {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    animation: qrCodeAppear 0.5s ease-out;
}

.qr-code-wrapper {
    background: var(--terminal-bg);
    border: 2px solid var(--neon-green);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.qr-code-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
    animation: qrCodeScan 2s ease-in-out infinite;
}

.qr-code-image {
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.5));
}

.qr-code-text {
    margin-top: 0.5rem;
    color: var(--neon-green);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-shadow: 0 0 5px var(--neon-green);
}

.qr-code-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--neon-cyan);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.qr-code-close:hover {
    background: rgba(255, 0, 0, 0.7);
    color: white;
    transform: scale(1.1);
}

@keyframes qrCodeAppear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes qrCodeScan {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}
