/* Digital Futuristic / Cyberpunk Design System */
:root {
    --bg-color: #060b13;
    --grid-color: rgba(5, 182, 129, 0.03);
    --panel-bg: rgba(6, 10, 24, 0.75);
    --panel-border: rgba(5, 182, 129, 0.2);
    --primary-color: #05b681; /* Neon Cyan */
    --primary-glow: rgba(5, 182, 129, 0.4);
    --accent-color: #34d399; /* Neon Magenta */
    --accent-glow: rgba(52, 211, 153, 0.35);
    --text-primary: #e2e8f0;
    --text-secondary: #38bdf8;
    --text-muted: #64748b;
    --success-color: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --border-radius-lg: 0px; /* Sharp corners for military/tech style */
    --border-radius-md: 0px;
    --border-radius-sm: 0px;
    --font-tech: 'Orbitron', -apple-system, sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --font-sans: 'Rajdhani', sans-serif;
    --transition-cyber: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1.1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Scanline overlay for retro-futuristic CRT screen effect */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    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));
    z-index: 9999;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
}

/* Glowing nebulas in the background */
.background-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(160px);
    z-index: -1;
    pointer-events: none;
}

.bg-glow-1 {
    top: -10%;
    left: 10%;
    width: 500px;
    height: 500px;
    background-color: var(--primary-glow);
    opacity: 0.15;
}

.bg-glow-2 {
    bottom: 10%;
    right: 10%;
    width: 500px;
    height: 500px;
    background-color: var(--accent-glow);
    opacity: 0.12;
}

/* Header */
header {
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    border-bottom: 1px solid rgba(5, 182, 129, 0.15);
    position: relative;
}

header::after {
    content: "SYS_STATUS: ACTIVE // PROTOCOL_V3.2";
    position: absolute;
    bottom: 0.25rem;
    right: 2rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-family: var(--font-tech);
    font-size: 2.4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
}

.magic-icon {
    color: var(--primary-color);
    text-shadow: 0 0 15px var(--primary-glow);
    animation: pulseGlow 2s ease-in-out infinite;
}

.accent-text {
    color: var(--accent-color);
    text-shadow: 0 0 15px var(--accent-glow);
}

.header-desc {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Container */
.container {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Utility classes */
.d-none {
    display: none !important;
}

.text-success {
    color: var(--success-color);
    text-shadow: 0 0 10px var(--success-glow);
}

/* Futuristic HUD Panel with brackets */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 15px rgba(5, 182, 129, 0.05);
    position: relative;
    margin-bottom: 2rem;
}

/* Panel Corner Brackets */
.glass-panel::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 15px;
    height: 15px;
    border-top: 3px solid var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.glass-panel::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 15px;
    height: 15px;
    border-bottom: 3px solid var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

/* 1. Upload section */
.upload-area {
    border: 1px solid rgba(5, 182, 129, 0.2);
    background: rgba(5, 182, 129, 0.01);
    padding: 5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-cyber);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.upload-area::before {
    content: "LOAD_FILE";
    position: absolute;
    top: 5px;
    left: 10px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(5, 182, 129, 0.4);
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(5, 182, 129, 0.03);
    box-shadow: 0 0 25px rgba(5, 182, 129, 0.15);
}

.upload-icon-wrapper {
    width: 90px;
    height: 90px;
    background: rgba(5, 182, 129, 0.02);
    border: 1px solid rgba(5, 182, 129, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: var(--transition-cyber);
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
}

.upload-area:hover .upload-icon-wrapper {
    background: rgba(5, 182, 129, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(5, 182, 129, 0.3);
}

.upload-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
    filter: drop-shadow(0 0 5px var(--primary-glow));
    transition: var(--transition-cyber);
}

.upload-area h3 {
    font-family: var(--font-tech);
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    max-width: 400px;
}

/* Futuristic Cyber Buttons */
.btn {
    font-family: var(--font-tech);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0.8rem 2rem;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: var(--transition-cyber);
    position: relative;
    clip-path: polygon(0 0, 92% 0, 100% 25%, 100% 100%, 8% 100%, 0 75%);
}

.btn-primary {
    background: rgba(5, 182, 129, 0.1);
    color: var(--primary-color);
    box-shadow: 0 0 15px rgba(5, 182, 129, 0.1);
}

.btn-primary:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 25px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(52, 211, 153, 0.05);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-secondary:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 25px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
    clip-path: polygon(0 0, 92% 0, 100% 25%, 100% 100%, 8% 100%, 0 75%);
}

.btn-outline:hover {
    background: #ef4444;
    color: #000;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-large {
    padding: 1.1rem 3rem;
    font-size: 1.05rem;
}

.btn-glow {
    animation: cyberPulse 2s infinite alternate;
}

/* 2. Editor Section */
.editor-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
}

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

.editor-preview-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.canvas-wrapper {
    position: relative;
    background: #020307;
    border: 1px solid rgba(5, 182, 129, 0.15);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    max-height: 600px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
}

/* Futuristic crosshair marks in the canvas wrapper */
.canvas-wrapper::before {
    content: "";
    position: absolute;
    top: 10px; left: 10px;
    width: 10px; height: 10px;
    border-top: 1px solid rgba(5, 182, 129, 0.3);
    border-left: 1px solid rgba(5, 182, 129, 0.3);
}

.canvas-wrapper::after {
    content: "";
    position: absolute;
    bottom: 10px; right: 10px;
    width: 10px; height: 10px;
    border-bottom: 1px solid rgba(5, 182, 129, 0.3);
    border-right: 1px solid rgba(5, 182, 129, 0.3);
}

#editorCanvas {
    display: block;
    max-width: 100%;
    max-height: 600px;
    cursor: crosshair;
}

.canvas-instructions {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    background: rgba(5, 182, 129, 0.02);
    padding: 0.6rem;
    border: 1px dashed rgba(5, 182, 129, 0.15);
}

.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 6, 15, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(5, 182, 129, 0.1);
    border-top-color: var(--primary-color);
    border-bottom-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.53, 0.21, 0.29, 0.67) infinite;
}

.loader-text {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Controls */
.editor-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.control-group {
    background: rgba(6, 10, 24, 0.8);
    border: 1px solid rgba(5, 182, 129, 0.1);
    padding: 1.5rem;
    position: relative;
}

.control-group::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 6px; height: 6px;
    background: var(--primary-color);
}

.control-group h4 {
    font-family: var(--font-tech);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
    border-bottom: 1px solid rgba(5, 182, 129, 0.15);
    padding-bottom: 0.6rem;
}

.button-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 0.75rem;
}

/* Futuristic radio choices */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(5, 182, 129, 0.01);
    border: 1px solid rgba(5, 182, 129, 0.15);
    padding: 1.1rem;
    cursor: pointer;
    transition: var(--transition-cyber);
    user-select: none;
    position: relative;
}

.radio-card input {
    display: none;
}

.radio-card:hover {
    background: rgba(5, 182, 129, 0.03);
    border-color: rgba(5, 182, 129, 0.4);
}

.radio-card.active {
    background: rgba(5, 182, 129, 0.05);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(5, 182, 129, 0.15);
}

.radio-card.active::after {
    content: "SELECTED";
    position: absolute;
    top: 5px;
    right: 10px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.radio-icon {
    width: 38px;
    height: 38px;
    background: rgba(5, 182, 129, 0.05);
    border: 1px solid rgba(5, 182, 129, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--primary-color);
    transition: var(--transition-cyber);
    flex-shrink: 0;
}

.radio-card.active .radio-icon {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 10px var(--primary-glow);
}

.radio-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.radio-title {
    font-family: var(--font-tech);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.radio-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#btnProcess {
    width: 100%;
}

/* 3. Progress Section */
.progress-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    padding: 1.5rem 0;
}

.progress-spinner-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.progress-ring-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
    stroke-dasharray: 326.72;
    stroke-dashoffset: 326.72;
}

.progress-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-tech);
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
}

.progress-container h3 {
    font-family: var(--font-tech);
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.progress-subtitle {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.progress-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(5, 182, 129, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    box-shadow: 0 0 8px var(--primary-color);
    width: 0;
    transition: width 0.3s ease;
}

.progress-warning {
    color: #f59e0b;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 0.75rem 1rem;
}

/* 4. Results Section */
.section-title {
    font-family: var(--font-tech);
    font-size: 1.6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.result-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

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

.result-card h4 {
    font-family: var(--font-tech);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.media-preview-box {
    background: #020307;
    border: 1px solid rgba(5, 182, 129, 0.15);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 450px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.media-preview-box img, .media-preview-box video {
    display: block;
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

@media (max-width: 480px) {
    .result-actions {
        flex-direction: column;
        gap: 1rem;
    }
    .result-actions .btn {
        width: 100%;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 2.5rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid rgba(5, 182, 129, 0.15);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    letter-spacing: 1px;
}

/* Cyber Scanning Line animation overlaying Canvas */
.scanning-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(5, 182, 129, 0.6);
    box-shadow: 0 0 10px var(--primary-color);
    animation: scan 3s linear infinite;
    pointer-events: none;
    z-index: 5;
}

/* Keyframe animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes scan {
    0% {
        top: 0%;
    }
    50% {
        top: 100%;
    }
    100% {
        top: 0%;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        text-shadow: 0 0 10px var(--primary-glow);
    }
    50% {
        text-shadow: 0 0 25px rgba(5, 182, 129, 0.8);
    }
}

@keyframes cyberPulse {
    0% {
        box-shadow: 0 0 8px rgba(5, 182, 129, 0.2);
    }
    100% {
        box-shadow: 0 0 20px rgba(5, 182, 129, 0.5);
    }
}

/* Tabs Container */
.tabs-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(5, 182, 129, 0.15);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-tech);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: var(--transition-cyber);
    position: relative;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
}

.tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -0.6rem;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* Batch Area Styles */
.batch-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
}

.input-hud-group {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.hud-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.hud-input {
    background: rgba(5, 182, 129, 0.02);
    border: 1px solid rgba(5, 182, 129, 0.2);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1.1rem;
    padding: 0.9rem 1.2rem;
    outline: none;
    transition: var(--transition-cyber);
}

.hud-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(5, 182, 129, 0.15);
    background: rgba(5, 182, 129, 0.04);
}

.batch-warning-box {
    width: 100%;
    max-width: 600px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #f87171;
}

.batch-warning-box i {
    font-size: 1.2rem;
    color: #ef4444;
    margin-top: 0.2rem;
}

.batch-instructions-box {
    width: 100%;
    max-width: 600px;
    background: rgba(5, 182, 129, 0.03);
    border: 1px solid rgba(5, 182, 129, 0.1);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    font-size: 0.95rem;
    line-height: 1.5;
}

.batch-instructions-box i {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-top: 0.2rem;
}

.batch-instructions-box p {
    margin-bottom: 0.5rem;
}

.batch-instructions-box p:last-child {
    margin-bottom: 0;
}

.animate-glow {
    animation: cyberPulse 2s infinite alternate;
}
