@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;700&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-base: #030303;
    --panel-bg: rgba(15, 15, 15, 0.85);
    --panel-border: rgba(239, 68, 68, 0.3);
    
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    
    --accent-red: #ef4444;
    --accent-red-hover: #dc2626;
    --accent-red-glow: rgba(239, 68, 68, 0.5);
    
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.5);
    
    --terminal-bg: #000000;
    --terminal-header: #111111;
}

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

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

/* Stark Grid Background */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(239, 68, 68, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(239, 68, 68, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    animation: fadeDown 0.6s ease-out;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

header::before {
    content: '';
    position: absolute;
    bottom: 0; left: 10%; right: 10%; height: 1px;
    background: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red-glow);
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary);
}

.neon-text {
    color: var(--accent-red);
    text-shadow: 0 0 20px var(--accent-red-glow);
}

header p {
    color: var(--text-muted);
    font-size: 1.15rem;
    font-family: 'Fira Code', monospace;
    letter-spacing: 0.05em;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
}

/* Layout */
.main-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2.5rem;
    flex: 1;
    align-items: start;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

/* Left Panel & Cards */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    padding: 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(15px);
    border-left: 3px solid var(--accent-red);
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
    border-left: 6px solid var(--accent-red);
    background: rgba(20, 20, 20, 0.95);
}

.card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Fira Code', monospace;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
}

/* Forms */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Fira Code', monospace;
}

input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: #090909;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
    background: #000;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn {
    background: var(--accent-red);
    color: white;
}

.primary-btn:hover {
    background: var(--accent-red-hover);
    box-shadow: 0 0 20px var(--accent-red-glow);
    transform: translateY(-2px);
}

.primary-btn:active {
    transform: translateY(1px);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.secondary-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 20px var(--accent-red-glow);
    transform: translateY(-2px);
}

/* Result Box */
.result-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
    word-break: break-all;
    animation: fadeIn 0.3s ease;
    font-family: 'Fira Code', monospace;
    border-left: 4px solid transparent;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-box.success {
    display: block;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-left-color: var(--accent-green);
    color: #6ee7b7;
}

.result-box.error {
    display: block;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-left-color: var(--accent-red);
    color: #fca5a5;
}

/* Hints */
.hints {
    padding: 2rem;
    border-radius: 12px;
    background: rgba(10, 10, 10, 0.9);
}

.hints h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
}

.hints ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hints code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    background: #000;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--accent-red);
    cursor: copy;
    display: inline-block;
    transition: all 0.2s ease;
}

.hints code:hover {
    color: #fff;
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
    transform: translateX(5px);
}

/* Terminal (Right Panel) */
.terminal-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.terminal-header {
    background: var(--terminal-header);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-family: 'Fira Code', monospace;
}

.pulse-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent-green);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green-glow);
    animation: pulsate 2s infinite ease-in-out;
}

@keyframes pulsate {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

.terminal-body {
    flex: 1;
    background: var(--terminal-bg);
    padding: 1.5rem;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 750px;
    position: relative;
}

/* CRT Scanline effect */
.terminal-body::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    z-index: 10;
    background-size: 100% 4px;
    pointer-events: none;
}

.log-entry {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid transparent;
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateX(10px);
    position: relative;
    z-index: 11;
}

@keyframes slideIn {
    to { opacity: 1; transform: translateX(0); }
}

.timestamp {
    color: #475569;
    margin-right: 0.75rem;
    font-size: 0.85rem;
}

.log-entry.system {
    color: var(--text-muted);
}

.log-entry.info {
    border-left-color: var(--text-muted);
    color: #e2e8f0;
}

.log-entry.info .method {
    color: #fff;
    font-weight: 700;
}

.log-entry.attack {
    border-left-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.08);
}

.log-entry.attack .alert-badge {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-right: 0.75rem;
}

.log-entry.attack .payload {
    display: block;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #000;
    border-radius: 4px;
    color: #fca5a5;
    word-break: break-all;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #000;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 68, 68, 0.5);
}

/* Mobile Responsiveness Enhancements */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    header {
        padding: 1.5rem 1rem;
        border-radius: 8px;
    }
    
    .card {
        padding: 1.5rem;
        border-radius: 8px;
    }
    
    .terminal-body {
        max-height: 400px;
        padding: 1rem;
    }
}
