/*
 * AssumeBreach.com - 90's Hacker Terminal Theme
 * Retro CRT monitor aesthetic
 */

/* Import retro monospace font */
@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&family=Fira+Code&display=swap');

/* CSS Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --terminal-green: #00ff00;
    --terminal-green-dim: #00aa00;
    --terminal-green-dark: #004400;
    --terminal-amber: #ffb000;
    --terminal-red: #ff0040;
    --terminal-cyan: #00ffff;
    --terminal-bg: #0a0a0a;
    --terminal-bg-light: #111111;
    --scanline-opacity: 0.05;
    --glow-intensity: 0.8;
}

/* Main body - CRT screen effect */
body {
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    background-color: var(--terminal-bg);
    color: var(--terminal-green);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* CRT screen overlay effects */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1000;
}

/* Screen flicker animation */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 0, 0.02);
    pointer-events: none;
    z-index: 999;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.97; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

/* Screen glow effect */
.screen-container {
    position: relative;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(ellipse at center, var(--terminal-bg-light) 0%, var(--terminal-bg) 100%);
}

/* ============================================
   LOGIN PAGE STYLES
   ============================================ */

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(0, 20, 0, 0.8);
    border: 2px solid var(--terminal-green-dim);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow:
        0 0 20px rgba(0, 255, 0, 0.2),
        inset 0 0 20px rgba(0, 255, 0, 0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2.5rem;
    color: var(--terminal-green);
    text-shadow: 0 0 10px var(--terminal-green);
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.login-header .subtitle {
    color: var(--terminal-green-dim);
    font-size: 1rem;
    letter-spacing: 2px;
}

.ascii-art {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.1;
    color: var(--terminal-green-dim);
    text-align: center;
    margin-bottom: 20px;
    white-space: pre;
    overflow: hidden;
    letter-spacing: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    color: var(--terminal-green-dim);
    font-size: 1rem;
    letter-spacing: 1px;
}

.form-group input {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--terminal-green-dark);
    color: var(--terminal-green);
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    padding: 12px 15px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: var(--terminal-green);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.form-group input::placeholder {
    color: var(--terminal-green-dark);
}

.login-btn {
    background: transparent;
    border: 2px solid var(--terminal-green);
    color: var(--terminal-green);
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    padding: 15px;
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.login-btn:hover {
    background: var(--terminal-green);
    color: var(--terminal-bg);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.login-btn:active {
    transform: scale(0.98);
}

.error-message {
    background: rgba(255, 0, 64, 0.1);
    border: 1px solid var(--terminal-red);
    color: var(--terminal-red);
    padding: 15px;
    text-align: center;
    font-size: 1rem;
    animation: error-flash 0.5s ease;
}

@keyframes error-flash {
    0%, 50% { opacity: 0.5; }
    25%, 75%, 100% { opacity: 1; }
}

.system-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--terminal-green-dark);
    font-size: 0.9rem;
    color: var(--terminal-green-dark);
}

.system-info p {
    margin: 5px 0;
}

.blink {
    animation: blink 1s step-end infinite;
}

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

/* ============================================
   CONSOLE PAGE STYLES
   ============================================ */

.console-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 10px;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 40, 0, 0.5);
    border: 1px solid var(--terminal-green-dark);
    margin-bottom: 10px;
}

.console-header h1 {
    font-size: 1.2rem;
    color: var(--terminal-green);
    letter-spacing: 2px;
}

.header-info {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--terminal-green-dim);
}

.header-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--terminal-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 5px var(--terminal-green); }
    50% { opacity: 0.5; box-shadow: none; }
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--terminal-red);
    color: var(--terminal-red);
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    padding: 5px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--terminal-red);
    color: var(--terminal-bg);
}

/* Terminal Window */
.terminal-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 10, 0, 0.9);
    border: 2px solid var(--terminal-green-dark);
    overflow: hidden;
}

.terminal-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: var(--terminal-green-dark);
    border-bottom: 1px solid var(--terminal-green-dim);
}

.terminal-titlebar .title {
    font-size: 0.9rem;
    color: var(--terminal-green);
    letter-spacing: 1px;
}

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

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.terminal-btn.close { background: #ff5f56; }
.terminal-btn.minimize { background: #ffbd2e; }
.terminal-btn.maximize { background: #27ca40; }

/* Terminal Output Area */
.terminal-output {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.3;
    white-space: pre-wrap;
    word-wrap: break-word;
    letter-spacing: 0;
}

.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: var(--terminal-bg);
}

.terminal-output::-webkit-scrollbar-thumb {
    background: var(--terminal-green-dark);
    border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: var(--terminal-green-dim);
}

/* Output line styles */
.output-line {
    margin: 2px 0;
}

.output-line.command {
    color: var(--terminal-cyan);
}

.output-line.response {
    color: var(--terminal-green);
}

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

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

.output-line.system {
    color: var(--terminal-green-dim);
    font-style: italic;
}

/* Terminal Input Area */
.terminal-input-area {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 20, 0, 0.5);
    border-top: 1px solid var(--terminal-green-dark);
}

.prompt {
    color: var(--terminal-cyan);
    margin-right: 10px;
    white-space: nowrap;
    font-size: 1.1rem;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--terminal-green);
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    outline: none;
    caret-color: var(--terminal-green);
}

.terminal-input::placeholder {
    color: var(--terminal-green-dark);
}

/* Cursor animation */
.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background: var(--terminal-green);
    animation: cursor-blink 1s step-end infinite;
    vertical-align: bottom;
}

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

/* Loading indicator */
.loading {
    display: inline-block;
    color: var(--terminal-amber);
}

.loading::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Attack detection banner */
.attack-detected {
    background: rgba(255, 0, 64, 0.2);
    border: 1px solid var(--terminal-red);
    color: var(--terminal-red);
    padding: 10px;
    margin: 10px 0;
    animation: attack-flash 0.3s ease 3;
}

@keyframes attack-flash {
    0%, 100% { background: rgba(255, 0, 64, 0.2); }
    50% { background: rgba(255, 0, 64, 0.4); }
}

/* ============================================
   ERROR PAGE STYLES
   ============================================ */

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 20px;
}

.error-code {
    font-size: 8rem;
    color: var(--terminal-red);
    text-shadow: 0 0 20px var(--terminal-red);
    line-height: 1;
}

.error-text {
    font-size: 2rem;
    color: var(--terminal-amber);
    margin: 20px 0;
    letter-spacing: 3px;
}

.error-details {
    color: var(--terminal-green-dim);
    max-width: 500px;
    line-height: 1.6;
}

.back-link {
    margin-top: 30px;
    color: var(--terminal-green);
    text-decoration: none;
    border: 1px solid var(--terminal-green);
    padding: 10px 30px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: var(--terminal-green);
    color: var(--terminal-bg);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .login-box {
        padding: 20px;
    }

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

    .ascii-art {
        font-size: 0.4rem;
    }

    .console-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-info {
        flex-wrap: wrap;
        justify-content: center;
    }

    .terminal-output {
        font-size: 0.9rem;
    }

    .terminal-input {
        font-size: 1rem;
    }
}

/* ============================================
   SPECIAL EFFECTS
   ============================================ */

/* Glitch effect for errors */
.glitch {
    animation: glitch 0.3s infinite;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* Text shadow glow effect */
.glow {
    text-shadow:
        0 0 5px var(--terminal-green),
        0 0 10px var(--terminal-green),
        0 0 20px var(--terminal-green);
}

/* Typing animation */
.typing {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

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