:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --accent-color: #00ff41;
    /* Cyberpunk Green */
    --accent-hover: #00cc33;
    --secondary-bg: #111;
    --border-color: #333;
    --font-mono: 'Roboto Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.grid-background {
    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: 30px 30px;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

header {
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.brand-name {
    font-size: 1.5rem;
    color: var(--accent-color);
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-separator {
    margin: 0 0.5rem;
    color: #666;
}

.nav-current {
    color: #888;
}

.tool-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-section {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    background: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.url-input-group {
    display: flex;
    gap: 1rem;
    flex: 2;
    min-width: 300px;
}

.file-input-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    justify-content: flex-end;
}

.param-separator {
    color: #666;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Hide default file input */
.hidden-input {
    display: none;
}

.file-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
}

#video-url {
    flex: 1;
    background: #000;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.8rem 1rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    border-radius: 4px;
}

#video-url:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-weight: bold;
}

.btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

.editor-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-in-out;
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

#artplayer-container {
    width: 100%;
    height: 100%;
}

.controls-wrapper {
    background: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.slider-container {
    margin-bottom: 2rem;
    padding: 0 10px;
}

#trim-slider {
    height: 10px;
    background: #333;
    border: none;
    box-shadow: none;
    margin-bottom: 1rem;
}

.noUi-connect {
    background: var(--accent-color);
}

.noUi-handle {
    background: var(--accent-color);
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    border-radius: 50%;
    cursor: pointer;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none;
}

.time-displays {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 10px;
}

.log-container {
    background: #000;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.8rem;
    margin-top: 1rem;
}

.log-container h3 {
    color: #888;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}

#logs {
    white-space: pre-wrap;
    color: #ccc;
}

.hidden {
    display: none;
}

footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Glitch Effect (Simplistic version) */
.glitch {
    position: relative;
}

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

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 15px, 0);
    }

    100% {
        clip: rect(95px, 9999px, 100px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    100% {
        clip: rect(5px, 9999px, 15px, 0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .input-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        /* More space between URL and File sections */
    }

    .url-input-group {
        flex-direction: column;
        gap: 0.8rem;
    }

    .url-input-group,
    .file-input-group {
        width: 100%;
        min-width: 0;
    }

    .file-input-group {
        justify-content: center;
        background: #1a1a1a;
        padding: 1rem;
        border-radius: 4px;
        border: 1px dashed #444;
    }

    #video-url {
        width: 100%;
    }

    #load-btn {
        width: 100%;
        justify-content: center;
    }

    #video-url {
        width: 100%;
    }

    .param-separator {
        margin: 0.5rem 0;
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 1.2rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .time-displays {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}