:root {
    --bg-color: #0d0f17;
    --panel-bg: rgba(26, 30, 41, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --success-color: #10b981;
    --error-color: #ef4444;
    --input-bg: rgba(15, 23, 42, 0.6);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Blobs for Glassmorphism Effect */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #3b82f644, transparent);
}

.blob-2 {
    bottom: -15%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, #8b5cf644, transparent);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #10b98122, transparent);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

/* Panel Styles */
.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 1rem;
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #cbd5e1;
}

.required {
    color: var(--error-color);
}

input[type="password"],
input[type="text"],
textarea,
select {
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    resize: vertical;
}

select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

select option {
    background: #1a1e29;
    color: white;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* File Upload Area */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: var(--input-bg);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
}

.upload-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.upload-placeholder .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.image-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10;
}

.hidden {
    display: none !important;
}

/* Sliders */
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#cfgValue {
    font-family: monospace;
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--accent-glow);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Buttons */
button, .btn-secondary {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    color: white;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    flex: 1;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Status & Logs */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: var(--input-bg);
    border-radius: 12px;
    font-weight: 500;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.idle { background: var(--text-secondary); }
.dot.running { 
    background: #f59e0b; 
    box-shadow: 0 0 10px #f59e0b;
    animation: pulse 1.5s infinite;
}
.dot.success {
    background: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}
.dot.error {
    background: var(--error-color);
    box-shadow: 0 0 10px var(--error-color);
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.log-window {
    background: #000;
    border-radius: 12px;
    padding: 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.05);
}

.log-entry { margin-bottom: 0.4rem; color: #cbd5e1; }
.log-entry.system { color: #8b5cf6; }
.log-entry.error { color: #ef4444; }
.log-entry.success { color: #10b981; }
.log-entry .time { color: #64748b; margin-right: 0.5rem; }

/* Video Player */
.video-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    animation: fadeIn 0.5s ease;
}

video {
    width: 100%;
    border-radius: 12px;
    background: #000;
    border: 1px solid rgba(255,255,255,0.1);
    aspect-ratio: 16 / 9;
}

.video-actions {
    display: flex;
    gap: 1rem;
}

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