@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --bg-color: #050505;
    /* Increased visibility for grid */
    --grid-color: rgba(255, 255, 255, 0.08);
    --primary: #00ff41;
    /* Brighter purple */
    --secondary: #d500f9;
    /* Pure white for better readability */
    --text-main: #ffffff;
    /* Lighter dim text for better contrast */
    --text-dim: #888;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Moving Grid Background */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 200vw;
    height: 200vh;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    animation: gridMove 20s linear infinite;
    opacity: 0.3;
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0) translateZ(-200px);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(40px) translateZ(-200px);
    }
}

/* Scanline Overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    z-index: 10;
    pointer-events: none;
}

/* Main Container */
.terminal-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    z-index: 1;
    position: relative;
    padding: 2rem;
}

/* Glitch Title */
.title-wrapper {
    position: relative;
    margin-bottom: 2rem;
    text-align: center;
}

h1 {
    font-size: 4rem;
    text-transform: uppercase;
    letter-spacing: 0.5rem;
    color: #fff;
    text-shadow: 2px 2px 0px var(--secondary);
    position: relative;
}

h1::before,
h1::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

h1::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

h1::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

/* System Status Box */
.system-status-box {
    border: 1px solid var(--text-dim);
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    width: 100%;
    max-width: 500px;
    margin-bottom: 3rem;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.05);
}

.status-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.blink {
    animation: blinker 1s linear infinite;
    color: var(--primary);
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
    border: 1px solid var(--text-dim);
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 87%;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(-45deg,
            rgba(255, 255, 255, 0.2) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.2) 75%,
            transparent 75%,
            transparent);
    background-size: 20px 20px;
    animation: move-stripes 1s linear infinite;
}

.status-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-dim);
}

@keyframes move-stripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 20px;
    }
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

/* Input Area */
.connect-container {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}

input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    padding: 1rem;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

button {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 0 2rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

button:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--primary);
}

/* Footer Data */
.ticker-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #000;
    border-top: 1px solid var(--text-dim);
    padding: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.ticker-content {
    display: inline-block;
    animation: ticker 30s linear infinite;
}

@keyframes glitch-anim {
    0% {
        clip: rect(13px, 9999px, 81px, 0);
    }

    20% {
        clip: rect(80px, 9999px, 9px, 0);
    }

    40% {
        clip: rect(100px, 9999px, 5px, 0);
    }

    60% {
        clip: rect(4px, 9999px, 66px, 0);
    }

    80% {
        clip: rect(20px, 9999px, 90px, 0);
    }

    100% {
        clip: rect(70px, 9999px, 12px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(4px, 9999px, 30px, 0);
    }

    40% {
        clip: rect(50px, 9999px, 12px, 0);
    }

    60% {
        clip: rect(20px, 9999px, 90px, 0);
    }

    80% {
        clip: rect(2px, 9999px, 33px, 0);
    }

    100% {
        clip: rect(50px, 9999px, 55px, 0);
    }
}

@keyframes ticker {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
        letter-spacing: 0.2rem;
    }

    .connect-container {
        flex-direction: column;
    }
}

/* Success Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #000;
    border: 1px solid var(--primary);
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
    position: relative;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.modal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.modal-quote {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.close-btn {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    padding: 0.8rem 2rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.close-btn:hover {
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}