/* === CSS Variables === */
:root {
    --color-bg: #0a0a0f;
    --color-bg-card: #12121a;
    --color-bg-field: #1a1a24;
    --color-text: #e4e4e7;
    --color-text-dim: #71717a;
    --color-text-bright: #fafafa;
    --color-accent: #ef4444;
    --color-accent-glow: rgba(239, 68, 68, 0.4);
    --color-warning: #f59e0b;
    --color-success: #22c55e;
    --color-info: #3b82f6;
    --color-critical: #dc2626;
    --color-catastrophic: #7c2d12;
    --color-border: #27272a;
    --color-border-glow: rgba(239, 68, 68, 0.2);
    
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-display: 'Space Grotesk', sans-serif;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font-mono);
    background: var(--color-bg);
    min-height: 100vh;
    color: var(--color-text);
    overflow-x: hidden;
    position: relative;
}

/* === Background Effects === */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    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: 100;
}

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 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: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* === Layout === */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* === Header === */
.header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.alert-lights {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

.light.red {
    background: var(--color-accent);
    box-shadow: 0 0 10px var(--color-accent), 0 0 20px var(--color-accent-glow);
}

.light:nth-child(2) { animation-delay: 0.33s; }
.light:nth-child(3) { animation-delay: 0.66s; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

.title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    color: var(--color-text-bright);
}

.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 2s infinite linear alternate-reverse;
    color: var(--color-accent);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 3s infinite linear alternate-reverse;
    color: var(--color-info);
    z-index: -2;
}

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

@keyframes glitch-2 {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
    25% { clip-path: inset(30% 0 50% 0); transform: translate(2px, -2px); }
    50% { clip-path: inset(50% 0 30% 0); transform: translate(-2px, 2px); }
    75% { clip-path: inset(70% 0 10% 0); transform: translate(1px, -1px); }
}

.subtitle {
    font-size: 1rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.status-text {
    color: var(--color-warning);
    animation: blink 1.5s ease-in-out infinite;
}

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

/* === Report Section === */
.report-section {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.report-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 
        0 0 0 1px var(--color-border-glow),
        0 20px 50px rgba(0, 0, 0, 0.5);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--color-bg-field);
    border-bottom: 1px solid var(--color-border);
}

.timestamp {
    font-size: 0.85rem;
    color: var(--color-text-dim);
}

.severity-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.severity-badge.critical {
    background: var(--color-critical);
    color: white;
}

.severity-badge.catastrophic {
    background: linear-gradient(135deg, var(--color-catastrophic), var(--color-critical));
    color: white;
    animation: catastrophicPulse 2s ease-in-out infinite;
}

.severity-badge.major {
    background: var(--color-warning);
    color: #1a1a24;
}

.severity-badge.minor {
    background: var(--color-info);
    color: white;
}

@keyframes catastrophicPulse {
    0%, 100% { box-shadow: 0 0 5px var(--color-critical); }
    50% { box-shadow: 0 0 20px var(--color-critical), 0 0 30px var(--color-accent-glow); }
}

/* === Report Body === */
.report-body {
    padding: 1.5rem;
}

.report-field {
    margin-bottom: 1.5rem;
}

.report-field:last-child {
    margin-bottom: 0;
}

.report-field.half {
    flex: 1;
}

.report-row {
    display: flex;
    gap: 1.5rem;
}

.field-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

.excuse-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--color-text-bright);
    padding: 1rem;
    background: var(--color-bg-field);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-accent);
}

.systems-list {
    list-style: none;
    padding: 1rem;
    background: var(--color-bg-field);
    border-radius: var(--radius-md);
}

.systems-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.systems-list li:last-child {
    margin-bottom: 0;
}

.systems-list li::before {
    content: '●';
    position: absolute;
    left: 0;
    color: var(--color-accent);
}

.eta-text,
.status-nashon {
    font-size: 1rem;
    color: var(--color-text);
    padding: 0.75rem 1rem;
    background: var(--color-bg-field);
    border-radius: var(--radius-md);
}

.eta-text {
    color: var(--color-warning);
}

.status-nashon {
    color: var(--color-info);
}

/* === Report Footer === */
.report-footer {
    padding: 1.5rem;
    background: var(--color-bg-field);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: center;
}

.generate-btn {
    background: linear-gradient(135deg, var(--color-accent) 0%, #b91c1c 100%);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 250px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--color-accent-glow);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.generate-btn .btn-text,
.generate-btn .btn-loading {
    transition: opacity 0.2s ease;
}

.generate-btn .btn-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.generate-btn.loading .btn-text { opacity: 0; }
.generate-btn.loading .btn-loading { opacity: 1; }

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Error Section === */
.error-section {
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.error-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--color-accent);
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.1rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.retry-btn {
    background: var(--color-accent);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #dc2626;
}

/* === Footer === */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-dim);
    font-size: 0.85rem;
}

.footer-sub {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.6;
}

/* === Utility === */
.hidden {
    display: none !important;
}

/* === Responsive === */
@media (max-width: 600px) {
    .title {
        font-size: 1.8rem;
        letter-spacing: 0.05em;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .report-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .report-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .excuse-text {
        font-size: 1.1rem;
    }
    
    .generate-btn {
        width: 100%;
    }
}

/* === Loading Animation on Page Load === */
.report-card {
    animation: cardAppear 0.8s ease-out;
}

@keyframes cardAppear {
    0% { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

