@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@300;400;700&family=Courier+Prime:wght@400;700&display=swap');

/* CSS Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000000;
    color: #00ff41;
    font-family: 'Source Code Pro', 'Courier Prime', monospace;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated matrix background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, #001100 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, #000011 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, #110000 0%, transparent 50%);
    animation: matrixShift 15s ease-in-out infinite;
    z-index: -1;
}

@keyframes matrixShift {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.3; }
}

/* Warning bar */
.warning-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ff0000;
    color: #ffffff;
    text-align: center;
    padding: 5px;
    font-weight: bold;
    z-index: 1000;
    animation: warningFlash 2s infinite;
}

@keyframes warningFlash {
    0%, 50% { background: #ff0000; }
    25%, 75% { background: #990000; }
}

/* Glitch effect */
.glitch {
    position: relative;
    display: inline-block;
    font-weight: bold;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: #ff0000;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% { transform: translate(0); }
    15%, 49% { transform: translate(-2px, -1px); }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% { transform: translate(0); }
    21%, 62% { transform: translate(2px, 1px); }
}

/* Terminal styling */
.terminal-container {
    margin-top: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 8px;
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.3),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
}

.terminal-header {
    background: linear-gradient(90deg, #003300, #001100);
    padding: 10px 15px;
    border-bottom: 1px solid #00ff41;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    color: #00ff41;
    font-weight: bold;
    font-size: 0.9rem;
}

.terminal-controls {
    display: flex;
    gap: 10px;
}

.terminal-controls span {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
}

.btn-close { background: #ff5f57; color: #000; }
.btn-minimize { background: #ffbd2e; color: #000; }
.btn-maximize { background: #28ca42; color: #000; }

.container {
    padding: 20px;
}

/* ASCII Art */
.ascii-art {
    text-align: center;
    margin-bottom: 30px;
}

.glitch-text {
    color: #00ff41;
    font-size: 0.7rem;
    line-height: 1;
    animation: textGlitch 3s infinite;
}

@keyframes textGlitch {
    0%, 90% { transform: translate(0); }
    92% { transform: translate(-1px, -1px); }
    94% { transform: translate(1px, 1px); }
    96% { transform: translate(-1px, 1px); }
    98% { transform: translate(1px, -1px); }
}

/* System status */
.system-status {
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid #00ff41;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.status-line {
    margin: 5px 0;
    font-size: 0.9rem;
}

.prompt {
    color: #00ff41;
    font-weight: bold;
}

.typing-text {
    color: #ffffff;
    animation: typing 3s steps(30) infinite;
}

@keyframes typing {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.output-text {
    color: #cccccc;
}

.output-text.error {
    color: #ff0000;
    animation: errorBlink 1s infinite;
}

@keyframes errorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Main content */
.main-content {
    margin: 30px 0;
}

.countdown-section {
    text-align: center;
    margin: 30px 0;
}

.countdown-section .label {
    color: #ff0000;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.countdown {
    font-size: 3rem;
    font-weight: bold;
    color: #ff0000;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    letter-spacing: 3px;
    animation: countdownPulse 2s infinite;
}

@keyframes countdownPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Data stream */
.data-stream {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff41;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.stream-header {
    color: #00ff41;
    font-weight: bold;
    margin-bottom: 10px;
}

.hex-dump {
    font-family: 'Courier Prime', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #ffffff;
}

.cursor-blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Matrix grid */
.matrix-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 2px;
    margin: 20px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.matrix-cell {
    aspect-ratio: 1;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid rgba(0, 255, 65, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.matrix-cell:hover {
    background: rgba(0, 255, 65, 0.3);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.matrix-cell.active {
    background: #00ff41;
    color: #000000;
    animation: cellHack 0.5s ease;
}

@keyframes cellHack {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Access panel */
.access-panel {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ff0000;
    padding: 20px;
    margin: 30px 0;
    border-radius: 6px;
    text-align: center;
}

.panel-header {
    color: #ff0000;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.auth-section {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

#auth-input {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 12px 15px;
    font-family: 'Source Code Pro', monospace;
    font-size: 1rem;
    border-radius: 4px;
    width: 300px;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#auth-input:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.auth-btn {
    background: linear-gradient(45deg, #ff0000, #990000);
    border: none;
    color: #ffffff;
    padding: 12px 25px;
    font-family: 'Source Code Pro', monospace;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.4);
}

.auth-attempts {
    color: #ff0000;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Navigation links */
.nav-links {
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid #00ff41;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.nav-header {
    color: #00ff41;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.nav-link {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 15px;
    margin: 5px 0;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #333333;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-family: 'Source Code Pro', monospace;
}

.nav-link:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: #00ff41;
    transform: translateX(5px);
}

/* Footer */
.footer-terminal {
    border-top: 1px solid #00ff41;
    padding: 15px 0;
    margin-top: 30px;
}

.system-info {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
    color: #cccccc;
    margin-bottom: 10px;
}

.status-online {
    color: #00ff41;
    font-weight: bold;
}

.warning-text {
    text-align: center;
    color: #ff0000;
    font-size: 0.85rem;
    font-weight: bold;
    animation: warningPulse 3s infinite;
}

@keyframes warningPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Hidden elements */
.hidden {
    display: none;
}

.hidden-payload {
    position: absolute;
    top: -1000px;
    left: -1000px;
    opacity: 0;
    pointer-events: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .terminal-container {
        margin: 20px 10px;
    }
    
    .countdown {
        font-size: 2rem;
    }
    
    .matrix-grid {
        grid-template-columns: repeat(12, 1fr);
    }
    
    .auth-section {
        flex-direction: column;
        align-items: center;
    }
    
    #auth-input {
        width: 100%;
        max-width: 300px;
    }
    
    .system-info {
        flex-direction: column;
        text-align: center;
    }
    
    .glitch-text {
        font-size: 0.5rem;
    }
}