:root {
    --primary: #00ff41;
    --secondary: #ff006e;
    --accent: #ffbe0b;
    --dark: #0a0e27;
    --mid-dark: #1a1f3a;
    --light: #e0e0e0;
    --shadow: rgba(0, 255, 65, 0.3);
}

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

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--dark);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated background grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
    animation: gridMove 20s linear infinite;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    animation: slideBar 3s ease-in-out infinite;
}

/* Navigation Menu */
.nav-menu {
    background: var(--mid-dark);
    border-top: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem;
    min-width: max-content;
}

.nav-btn {
    background: var(--dark);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.75rem 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.nav-btn:hover {
    background: var(--primary);
    color: var(--dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow);
}

.nav-btn.nav-new {
    border-color: var(--secondary);
    color: var(--secondary);
    position: relative;
}

.nav-btn.nav-new::after {
    content: 'NEW';
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary);
    color: var(--dark);
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 900;
}

.nav-btn.nav-new:hover {
    background: var(--secondary);
    color: var(--dark);
}

@keyframes slideBar {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

h1 {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
    text-shadow: 
        3px 3px 0 var(--secondary),
        6px 6px 0 var(--accent);
    animation: glitch 5s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    91% { transform: translate(-2px, 2px); }
    92% { transform: translate(2px, -2px); }
    93% { transform: translate(-2px, 2px); }
    94% { transform: translate(0); }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.3em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: var(--mid-dark);
    border: 3px solid var(--primary);
    padding: 2rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary);
    box-shadow: 0 20px 50px var(--shadow);
}

.card:hover::before {
    opacity: 0.05;
}

.card h2 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.8rem;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card h2::before {
    content: '>';
    color: var(--secondary);
    font-size: 1.5rem;
}

.input-group {
    margin: 1.5rem 0;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

input, select {
    width: 100%;
    padding: 1rem;
    background: var(--dark);
    border: 2px solid var(--primary);
    color: var(--light);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    transition: all 0.3s;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 20px var(--shadow);
}

.output {
    background: var(--dark);
    padding: 1rem;
    border: 2px solid var(--primary);
    margin: 1rem 0;
    font-size: 1.1rem;
    color: var(--primary);
    min-height: 60px;
    display: flex;
    align-items: center;
    word-break: break-all;
    position: relative;
    overflow: hidden;
}

.output::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
    animation: scanline 2s linear infinite;
}

@keyframes scanline {
    0% { left: -100%; }
    100% { left: 100%; }
}

.btn {
    background: var(--primary);
    color: var(--dark);
    border: none;
    padding: 1rem 2rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--secondary);
    transition: left 0.3s;
}

.btn:hover::before {
    left: 0;
}

.btn span {
    position: relative;
    z-index: 1;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.95);
}

.btn-secondary {
    background: var(--secondary);
    margin-left: 0.5rem;
}

.btn-secondary::before {
    background: var(--accent);
}

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    background: var(--dark);
    border: 2px solid var(--primary);
    color: var(--light);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 20px var(--shadow);
}

.color-preview {
    width: 100%;
    height: 80px;
    border: 2px solid var(--primary);
    margin: 1rem 0;
    background: var(--dark);
    transition: all 0.3s;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

footer {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 5rem;
    border-top: 3px solid var(--primary);
    background: var(--mid-dark);
}

footer p {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary);
    color: var(--dark);
    padding: 1rem 2rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 3px solid var(--secondary);
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    clip-path: polygon(15px 0, 100% 0, calc(100% - 15px) 100%, 0 100%);
}

.notification.show {
    transform: translateX(0);
}

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

    h1 {
        font-size: 3rem;
    }

    .card {
        padding: 1.5rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn-secondary {
        margin-left: 0;
    }

    .nav-container {
        padding: 1rem;
        gap: 0.3rem;
    }

    .nav-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* Animation delays for staggered entrance */
.card:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.1s both; }
.card:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.2s both; }
.card:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.3s both; }
.card:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.4s both; }
.card:nth-child(5) { animation: fadeInUp 0.6s ease-out 0.5s both; }
.card:nth-child(6) { animation: fadeInUp 0.6s ease-out 0.6s both; }
.card:nth-child(7) { animation: fadeInUp 0.6s ease-out 0.7s both; }
.card:nth-child(8) { animation: fadeInUp 0.6s ease-out 0.8s both; }
.card:nth-child(9) { animation: fadeInUp 0.6s ease-out 0.9s both; }
.card:nth-child(10) { animation: fadeInUp 0.6s ease-out 1.0s both; }
.card:nth-child(11) { animation: fadeInUp 0.6s ease-out 1.1s both; }
.card:nth-child(12) { animation: fadeInUp 0.6s ease-out 1.2s both; }
.card:nth-child(13) { animation: fadeInUp 0.6s ease-out 1.3s both; }
.card:nth-child(14) { animation: fadeInUp 0.6s ease-out 1.4s both; }
.card:nth-child(15) { animation: fadeInUp 0.6s ease-out 1.5s both; }
.card:nth-child(16) { animation: fadeInUp 0.6s ease-out 1.6s both; }

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