@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');

/* CRT Flicker Animation */
@keyframes flicker {
    0% {
        opacity: 0.95;
    }

    5% {
        opacity: 0.97;
    }

    10% {
        opacity: 0.94;
    }

    15% {
        opacity: 0.96;
    }

    20% {
        opacity: 0.95;
    }

    25% {
        opacity: 0.98;
    }

    30% {
        opacity: 0.96;
    }

    35% {
        opacity: 0.94;
    }

    40% {
        opacity: 0.97;
    }

    45% {
        opacity: 0.95;
    }

    50% {
        opacity: 0.96;
    }

    55% {
        opacity: 0.98;
    }

    60% {
        opacity: 0.95;
    }

    65% {
        opacity: 0.94;
    }

    70% {
        opacity: 0.96;
    }

    75% {
        opacity: 0.97;
    }

    80% {
        opacity: 0.95;
    }

    85% {
        opacity: 0.98;
    }

    90% {
        opacity: 0.96;
    }

    95% {
        opacity: 0.94;
    }

    100% {
        opacity: 0.95;
    }
}

@keyframes scanline {
    0% {
        top: -20px;
        box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0);
    }

    100% {
        top: 100vh;
        box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0);
    }
}

@keyframes scanlineDistortion {
    0% {
        clip-path: inset(0 0 100% 0);
        transform: translateX(0);
    }

    100% {
        clip-path: inset(100% 0 0 0);
        transform: translateX(0);
    }
}

body {
    background: #000;
    color: #00ff41;
    font-family: 'Syne Mono', sans-serif;
    font-size: 18px;
    padding: 2em;
    padding-bottom: 120px;
    position: relative;
    animation: flicker 0.15s infinite;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Distortion layer that follows scanline */
body>* {
    position: relative;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom,
            transparent,
            rgba(0, 255, 65, 0.1),
            transparent);
    pointer-events: none;
    z-index: 9998;
    animation: scanline 90s linear infinite;
    box-shadow: 0 0 60px 30px rgba(0, 255, 65, 0.05);
    filter: blur(2px);
}

/* CRT Scanline Effect */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent 50%,
            rgba(0, 255, 65, 0.03) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
}

/* Moving scanline */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom,
            transparent,
            rgba(0, 255, 65, 0.1),
            transparent);
    pointer-events: none;
    z-index: 9998;
    animation: scanline 45s linear infinite;
}

#messages {
    background: #000;
    border: 2px solid #00ff41;
    padding: 20px;
    margin: 20px auto;
    max-width: 800px;
    height: 500px;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

#messages>div {
    margin: 10px 0;
    text-shadow: 0 0 5px #00ff41;
}

input {
    background: #000;
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.5em !important;
    font-family: 'Syne Mono', sans-serif;
    font-size: 18px;
    width: 100%;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

input::placeholder {
    color: #006622;
}

input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

form {
    /* display: flex; */
    gap: 0.5rem;
    border-radius: 0;
    /* background: radial-gradient(circle at center, rgb(0, 0, 0), transparent 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); */
}

button {
    background: #000;
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.75rem 2rem;
    font-family: 'Syne Mono', sans-serif;
    font-size: 16px;
    font-weight: bold;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    transition: all 0.3s ease;
    text-shadow: 0 0 5px #00ff41;
}

button:hover {
    background: #00ff41;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
    text-shadow: none;
}

h1 {
    text-align: center;
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
    font-size: 48px;
    margin: 20px 0;
}

strong {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

/* Markdown elements should inherit parent color */
.marked em,
.marked strong,
.marked b,
.marked i,
.marked code,
.marked p,
.marked li,
.marked a {
    color: inherit !important;
    text-shadow: inherit !important;
}

small {
    color: #ff6b00;
    text-shadow: 0 0 5px #ff6b00;
}

/* Card Grid Container */
#cards,
.cards-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
    max-width: 1400px !important;
    margin: 2rem auto !important;
    padding: 2rem !important;
}

@media (min-width: 768px) {

    #cards,
    .cards-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 1280px) {

    #cards,
    .cards-grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

/* Section header styling */
.section-header {
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-left: 2rem;
}

/* Card Styling with retro glow */
.card {
    background: rgba(0, 0, 0, 0.9) !important;
    border: 2px solid currentColor !important;
    border-style: solid !important;
    padding: 1rem !important;
    border-radius: 0 !important;
    box-shadow:
        0 0 20px currentColor,
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        inset 0 0 2px currentColor !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    outline: 1px solid rgba(255, 255, 255, 0.1) !important;
    outline-offset: -4px !important;
    box-sizing: border-box !important;
    min-height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    cursor: pointer !important;
}

.card.selected {
    background: #000 !important;
    box-shadow:
        0 0 30px currentColor,
        inset 0 0 10px currentColor !important;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 30px currentColor !important;
}

/* Override Tailwind's border reset */
.card::before,
.card::after {
    border-style: solid !important;
}

/* Popup animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}