/* ============================================================
   w4ttz :: alive.css
   Theme: INDIGO / BLACK / PURPLE / HOLO CYAN
   ============================================================ */

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

:root {
    --bg-void: #0a0714;
    --bg-deep: #120b22;
    --bg-panel: #1a1030;
    --bg-elevated: #221741;
    --bg-input: #0d0820;

    --purple-900: #2a1a4a;
    --purple-700: #4c2a7a;
    --purple-500: #7b3fa0;
    --purple-400: #9d4edd;
    --purple-300: #c77dff;
    --purple-200: #e0aaff;

    --holo-cyan: #00e5ff;
    --holo-glow: #7df9ff;
    --holo-soft: #a8f0ff;

    --text-primary: #e0aaff;
    --text-bright: #f0d9ff;
    --text-dim: #9d7ab8;
    --text-faint: #5a4278;

    --success: #7df9ff;
    --danger: #ff4d6d;
    --warning: #ffb347;
}

body {
    font-family: 'Courier New', monospace;
    background: var(--bg-void);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* ---------- Background layers ---------- */

.grid-overlay {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(157, 78, 221, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(157, 78, 221, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    animation: gridScroll 20s linear infinite;
    pointer-events: none;
}

@keyframes gridScroll {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.35) 2px,
        rgba(0, 0, 0, 0.35) 4px
    );
    pointer-events: none;
    z-index: 1;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0%   { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.crt-glow {
    position: fixed;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        rgba(157, 78, 221, 0.06) 0%,
        rgba(0, 229, 255, 0.02) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 1;
    animation: pulseGlow 4s ease-in-out infinite;
}

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

.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    top: 0;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--purple-200);
    /* Matches artemis_run's mote glow so the field reads the same everywhere */
    box-shadow: 0 0 8px 1px var(--purple-300), 0 0 18px 3px rgba(157, 78, 221, 0.45);
    animation: floatParticle linear infinite;
    opacity: 0;
    will-change: transform, opacity;
}

.particle.cyan {
    background: var(--holo-glow);
    box-shadow: 0 0 10px 1px var(--holo-cyan), 0 0 22px 4px rgba(0, 229, 255, 0.5);
}

@keyframes floatParticle {
    0%   { opacity: 0; transform: translateY(112vh) scale(0.4); }
    6%   { opacity: 1; }
    94%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-9vh) scale(1.15); }
}

/* ---------- Layout ---------- */

.container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: var(--purple-200);
    text-shadow:
        0 0 10px rgba(157, 78, 221, 0.6),
        0 0 20px rgba(157, 78, 221, 0.4),
        0 0 40px rgba(0, 229, 255, 0.15);
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 8px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.subtitle {
    text-align: center;
    color: var(--holo-cyan);
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    letter-spacing: 4px;
    margin-bottom: 30px;
    animation: subtitlePulse 2s ease-in-out infinite;
}

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

/* ---------- Card ---------- */

.code-container {
    background: rgba(18, 11, 34, 0.85);
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden;
    border: 1px solid rgba(157, 78, 221, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.code-container:hover {
    border-color: rgba(199, 125, 255, 0.4);
    box-shadow: 0 0 40px rgba(157, 78, 221, 0.15);
}

.code-header {
    background: linear-gradient(
        90deg,
        rgba(26, 16, 48, 0.95) 0%,
        rgba(34, 23, 65, 0.95) 100%
    );
    color: var(--purple-200);
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid rgba(157, 78, 221, 0.2);
}

.code-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.code-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------- Badges ---------- */

.public-badge {
    background: rgba(0, 229, 255, 0.15);
    color: var(--holo-cyan);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: bold;
    border: 1px solid rgba(0, 229, 255, 0.25);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.user-badge {
    background: rgba(255, 179, 71, 0.15);
    color: var(--warning);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: bold;
    border: 1px solid rgba(255, 179, 71, 0.3);
}

.public-badge.denied-badge {
    background: rgba(255, 77, 109, 0.15);
    color: var(--danger);
    border-color: rgba(255, 77, 109, 0.3);
    text-shadow: 0 0 8px rgba(255, 77, 109, 0.3);
}

/* ---------- Author / labels ---------- */

.snippet-author {
    color: var(--holo-cyan);
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.author-tooltip {
    cursor: help;
    border-bottom: 1px dashed var(--holo-cyan);
}

.language-label {
    background: rgba(157, 78, 221, 0.25);
    color: var(--purple-200);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    border: 1px solid rgba(199, 125, 255, 0.3);
}

/* ---------- Table ---------- */

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 18px;
    text-align: left;
    font-size: 13px;
    font-family: 'Fira Code', 'Courier New', monospace;
    border-bottom: 1px solid rgba(157, 78, 221, 0.12);
}

th {
    color: var(--holo-cyan);
    background: rgba(157, 78, 221, 0.06);
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    font-weight: normal;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

td:first-child {
    color: var(--text-faint);
    letter-spacing: 1px;
    width: 35%;
}

td.ok {
    color: var(--holo-soft);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

td.bad {
    color: var(--danger);
    text-shadow: 0 0 8px rgba(255, 77, 109, 0.3);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(157, 78, 221, 0.04);
}

/* ---------- Timestamp / errors ---------- */

.timestamp {
    font-size: 0.8em;
    color: var(--text-faint);
    margin-top: 5px;
    padding: 5px 15px 10px;
    font-family: 'Courier New', monospace;
}

.error-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--danger);
    text-shadow: 0 0 12px rgba(255, 77, 109, 0.4);
    letter-spacing: 3px;
    font-size: 1rem;
}

/* ---------- Status bar ---------- */

.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 20px;
    background: rgba(10, 7, 20, 0.95);
    border-top: 1px solid rgba(157, 78, 221, 0.2);
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-faint);
    z-index: 10;
    font-family: 'Courier New', monospace;
    backdrop-filter: blur(5px);
}

.status-bar .status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-bar .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--holo-cyan);
    box-shadow: 0 0 8px var(--holo-cyan);
    animation: dotPulse 2s ease-in-out infinite;
}

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

/* ---------- Selection & scrollbar ---------- */

::selection {
    background: rgba(0, 229, 255, 0.3);
    color: var(--text-bright);
}

::-moz-selection {
    background: rgba(0, 229, 255, 0.3);
    color: var(--text-bright);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--purple-700);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-500);
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
        letter-spacing: 5px;
    }

    .code-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .code-header-right {
        width: 100%;
        flex-wrap: wrap;
    }

    th,
    td {
        padding: 10px 12px;
        font-size: 12px;
    }

    td:first-child {
        width: 45%;
    }
}
