:root {
    --bg: #0a0a0f;
    --panel: #12121a;
    --text: #e0e0e0;
    --accent: #00d9ff;
    /* Electric Blue */
    --accent-dark: #007a99;
    --border: #1f1f2e;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Subtle digital noise background texture */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

.container {
    width: 100%;
    max-width: 1000px;
}

/* --- HEADER --- */
header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-family: 'Share Tech Mono', monospace;
    font-size: 2.5rem;
    color: var(--accent);
    text-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.tagline {
    color: #888;
    letter-spacing: 1px;
}

/* --- UPLOAD ZONE --- */
.upload-zone {
    border: 2px dashed var(--border);
    background: var(--panel);
    padding: 50px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.1);
}

#fileInput {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-content i {
    color: var(--accent);
    margin-bottom: 15px;
}

/* --- EDITOR INTERFACE --- */
/* FORCE HIDE */
.hidden {
    display: none !important;
}

.editor-interface {
    margin-top: 30px;
}

.comparison-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
}

@media (max-width: 768px) {
    .comparison-view {
        grid-template-columns: 1fr;
    }
}

.img-container {
    background: var(--panel);
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
}

h4 {
    font-family: 'Share Tech Mono';
    color: var(--accent-dark);
    margin: 5px 0;
}

img,
canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
}

/* --- PROCESSING ANIMATION --- */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.scanner-bar {
    width: 80%;
    height: 3px;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    animation: scan 1.5s infinite ease-in-out;
    margin-bottom: 15px;
}

@keyframes scan {
    0% {
        width: 10%;
        opacity: 0.5;
    }

    50% {
        width: 80%;
        opacity: 1;
    }

    100% {
        width: 10%;
        opacity: 0.5;
    }
}

.processing-overlay span {
    font-family: 'Share Tech Mono';
    color: var(--accent);
    letter-spacing: 2px;
}

/* --- CONTROLS --- */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 8px;
}

h3 {
    color: var(--accent);
    font-family: 'Share Tech Mono';
    border-bottom: 1px dashed var(--border);
    padding-bottom: 10px;
    margin-top: 0;
}

.control-group {
    margin-bottom: 20px;
}

.slider {
    width: 80%;
    margin-right: 10px;
    accent-color: var(--accent);
}

#noiseValue {
    font-family: 'Share Tech Mono';
    color: var(--accent);
}

/* Custom Checkboxes */
.toggles {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: var(--border);
    border-radius: 3px;
}

.checkbox-container:hover input~.checkmark {
    background-color: #333;
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid black;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Buttons */
.actions {
    display: flex;
    gap: 15px;
}

button {
    padding: 12px 24px;
    font-family: 'Share Tech Mono';
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.btn-main {
    background: var(--accent);
    color: #000;
    font-weight: bold;
}

.btn-main:hover {
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-secondary:hover {
    background: rgba(0, 217, 255, 0.1);
}

/* --- NEW STYLES: Navigation & Reset --- */

/* Back Button (Top Left) */
.top-nav {
    position: absolute;
    top: 20px;
    left: 20px;
}

.back-link {
    color: #666;
    text-decoration: none;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    border: 1px solid #333;
    padding: 5px 10px;
    border-radius: 4px;
    transition: 0.3s;
}

.back-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.2);
}

@media (max-width: 600px) {
    .top-nav {
        position: static;
        margin-bottom: 20px;
        display: block;
        text-align: left;
    }
}

/* Reset Button (Red/Danger) */
.btn-danger {
    background: transparent;
    border: 1px solid #ff0055;
    color: #ff0055;
}

.btn-danger:hover {
    background: rgba(255, 0, 85, 0.1);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.3);
}

.top-nav {
    margin-bottom: 20px;
}

.back-link {
    color: #666;
    text-decoration: none;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    border: 1px solid #333;
    padding: 5px 10px;
    border-radius: 4px;
    transition: 0.3s;
    display: inline-block;
}

.back-link:hover {
    color: var(--text);
    /* Hacker Green */
    border-color: var(--text);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    background: rgba(0, 255, 65, 0.05);
}