:root {
    --bg-color: #050505;
    --card-bg: #121212;
    --text-main: #e0e0e0;
    --text-muted: #888888;
    --accent-gold: #f5c542;
    --accent-dark: #b8860b;
    --border-color: #333333;
    --alert-red: #ff4444;
}

body { 
    font-family: 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif; 
    text-align: center; 
    padding: 40px 20px; 
    background-color: var(--bg-color); 
    color: var(--text-main);
    background-image: 
        linear-gradient(rgba(20, 20, 20, 0.8) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 20, 20, 0.8) 1px, transparent 1px);
    background-size: 40px 40px;
}

.card { 
    background: var(--card-bg); 
    padding: 0; 
    border: 1px solid var(--accent-dark); 
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(245, 197, 66, 0.1); 
    max-width: 600px; 
    margin: auto; 
    overflow: hidden; 
    position: relative;
    min-height: 400px;
}

.card::before { content: ""; position: absolute; top: 0; left: 0; width: 10px; height: 10px; border-top: 2px solid var(--accent-gold); border-left: 2px solid var(--accent-gold); }
.card::after { content: ""; position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border-bottom: 2px solid var(--accent-gold); border-right: 2px solid var(--accent-gold); }

.header { 
    padding: 30px; 
    background: linear-gradient(180deg, rgba(245, 197, 66, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
}

.logo-container { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 15px; }
.custom-logo { width: 60px; height: 60px; filter: drop-shadow(0 0 5px var(--accent-gold)); }

.header h1 { 
    margin: 0; font-size: 1.8rem; font-weight: 300; letter-spacing: 2px; 
    text-transform: uppercase; color: var(--accent-gold); text-shadow: 0 0 10px rgba(245, 197, 66, 0.3);
}

.stats-bar { 
    background: rgba(0, 0, 0, 0.5); padding: 8px 15px; font-size: 0.85rem; color: var(--text-muted); 
    margin-top: 10px; border: 1px solid var(--border-color); border-radius: 2px; display: inline-block; 
    font-family: 'Courier New', monospace; 
}
.stats-val { font-weight: bold; color: var(--accent-gold); }
.stats-offline { color: var(--alert-red); font-weight: bold; animation: blink 1.5s infinite; text-shadow: 0 0 5px var(--alert-red); }
.stats-online { color: #00ff41; font-weight: bold; text-shadow: 0 0 5px rgba(0, 255, 65, 0.5); }
        
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

/* TABS */
.tabs { display: flex; background: #000; border-bottom: 1px solid var(--border-color); }
.tab { 
    flex: 1; padding: 15px 10px; font-weight: 500; color: var(--text-muted); cursor: pointer; 
    transition: 0.3s; font-size: 0.9rem; border-bottom: 2px solid transparent; 
    text-transform: uppercase; letter-spacing: 1px;
}
/* Ensure sufficient contrast on hover by using a dark text color over the light accent background */
.tab:hover { color: #111111; background: rgba(245, 197, 66, 0.35); }
.tab.active { color: var(--accent-gold); background: rgba(245, 197, 66, 0.05); border-bottom: 2px solid var(--accent-gold); }
        
.tab-content { display: none; padding: 40px 30px; text-align: left; }
.tab-content.active { display: block; animation: fadeIn 0.4s; }
        
/* --- DRAG AND DROP ZONE --- */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 140px; /* Big drop area */
    border: 2px dashed var(--border-color);
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    margin-top: 20px;
    margin-bottom: 15px;
    cursor: pointer;
}

.file-upload-wrapper:hover {
    border-color: var(--accent-gold);
    background: rgba(245, 197, 66, 0.05);
}

/* The hidden input covers the entire parent */
.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-icon {
    width: 40px; height: 40px; stroke: var(--text-muted); margin-bottom: 10px; transition: 0.3s;
}
.upload-text {
    font-family: 'Courier New', monospace; color: var(--text-muted); font-size: 0.9rem; font-weight: bold; transition: 0.3s;
}

/* State when file is selected */
.file-upload-wrapper.has-file {
    border-style: solid;
    border-color: var(--accent-gold);
    background: rgba(245, 197, 66, 0.05);
}
.file-upload-wrapper.has-file .upload-icon { stroke: var(--accent-gold); }
.file-upload-wrapper.has-file .upload-text { color: var(--accent-gold); }

.file-size-display { 
    font-size: 0.85rem; color: var(--accent-gold); font-family: 'Courier New', monospace; 
    margin-bottom: 15px; display: block; min-height: 20px; text-align: center;
}

/* --- CONTROLS --- */
label { font-weight: bold; display: block; margin-top: 20px; margin-bottom: 8px; color: var(--text-main); font-size: 0.9rem; }
        
select, input[type="number"] { 
    width: 100%; padding: 12px; margin-bottom: 5px; background: #000; border: 1px solid var(--border-color); 
    color: #fff; border-radius: 2px; box-sizing: border-box; outline: none; transition: border 0.3s;
}
select:focus, input:hover { border-color: var(--accent-gold); }
        
/* TARGET SIZE SLIDER */
.target-wrapper { margin-top: 15px; padding: 15px; border: 1px dashed var(--border-color); background: rgba(255,255,255,0.02); }
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9rem; color: var(--text-muted); }
input[type="checkbox"] { width: auto; accent-color: var(--accent-gold); transform: scale(1.2); }

.target-controls { display: none; margin-top: 15px; }
.show-target .target-controls { display: block; }
.show-target .level-group { display: none; }

.slider-container { display: flex; align-items: center; gap: 15px; }
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; margin: 0; }
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%;
    background: var(--accent-gold); cursor: pointer; margin-top: -6px; box-shadow: 0 0 5px var(--accent-gold);
}
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: #333; border-radius: 2px; }
input.target-number { width: 80px; text-align: center; color: var(--accent-gold); font-weight: bold; }
.unit-label { color: var(--text-muted); font-size: 0.9rem; font-weight: bold; }

/* BUTTONS */
button { 
    width: 100%; padding: 14px; background: transparent; color: var(--accent-gold); 
    border: 1px solid var(--accent-gold); border-radius: 2px; font-size: 16px; 
    cursor: pointer; transition: 0.3s; margin-top: 20px; font-weight: bold; 
    text-transform: uppercase; letter-spacing: 2px; position: relative; overflow: hidden;
}
button:hover { background: var(--accent-gold); color: #000; box-shadow: 0 0 15px rgba(245, 197, 66, 0.4); }
button:disabled { border-color: #444; color: #444; cursor: not-allowed; background: transparent; box-shadow: none; }

/* PROGRESS UI */
.progress-container { display: none; margin-top: 25px; text-align: left; padding: 0 30px; }
.progress-label { font-size: 0.85rem; color: var(--accent-gold); margin-bottom: 5px; display: flex; justify-content: space-between; font-family: 'Courier New', monospace; }
.progress-bar-bg { width: 100%; background-color: #000; border: 1px solid var(--border-color); height: 12px; overflow: hidden; }
.progress-bar-fill { height: 100%; background-color: var(--accent-gold); width: 0%; transition: width 0.2s; box-shadow: 0 0 10px var(--accent-gold); }
        
.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.3) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.3) 75%, transparent 75%, transparent);
    background-size: 20px 20px; animation: progress-bar-stripes 1s linear infinite;
}
@keyframes progress-bar-stripes { 0% { background-position: 20px 0; } 100% { background-position: 0 0; } }

.processing-timer { font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; display: none; font-family: 'Courier New', monospace; transition: color 0.5s ease; }
        
.btn-cancel {
    width: 100%; margin-top: 15px; padding: 10px; font-size: 0.8rem;
    color: var(--alert-red); border: 1px solid var(--alert-red); background: transparent; 
    cursor: pointer; text-transform: uppercase; transition: 0.3s;
}
.btn-cancel:hover { background: var(--alert-red); color: #fff; box-shadow: 0 0 10px rgba(255, 68, 68, 0.4); }

.info { font-size: 0.8rem; color: var(--text-muted); background: rgba(255,255,255,0.03); padding: 15px; border-left: 2px solid var(--accent-gold); margin-top: 25px; line-height: 1.5; }
        
.spinner {
    display: none; width: 20px; height: 20px; border: 2px solid rgba(245, 197, 66, 0.3); 
    border-radius: 50%; border-top-color: var(--accent-gold); animation: spin 1s ease-in-out infinite; 
    position: absolute; left: 50%; top: 50%; margin-left: -10px; margin-top: -10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
        
/* Maintenance */
.maintenance-container { padding: 60px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gear-icon { width: 80px; height: 80px; margin-bottom: 20px; animation: spin-slow 4s infinite linear; }
@keyframes spin-slow { 100% { transform: rotate(360deg); } }
.maintenance-title { color: var(--alert-red); font-size: 1.5rem; letter-spacing: 2px; margin-bottom: 10px; text-transform: uppercase; }
.maintenance-desc { color: var(--text-muted); font-family: 'Courier New', monospace; font-size: 0.9rem; }

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

/* --- Maintenance page specific styles (extracted) --- */
.container { 
    border: 1px solid var(--accent-gold);
    padding: 40px;
    border-radius: 4px;
    background: #121212;
    box-shadow: 0 0 20px rgba(245, 197, 66, 0.1);
    max-width: 500px;
    position: relative;
}
.container::before { content: ""; position: absolute; top: -1px; left: -1px; width: 15px; height: 15px; border-top: 3px solid var(--accent-gold); border-left: 3px solid var(--accent-gold); }
.container::after { content: ""; position: absolute; bottom: -1px; right: -1px; width: 15px; height: 15px; border-bottom: 3px solid var(--accent-gold); border-right: 3px solid var(--accent-gold); }
.container h1 { 
    color: var(--accent-gold); 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    font-size: 2rem; 
    margin-bottom: 10px;
}
.container p { color: #888; font-family: 'Courier New', monospace; }
.icon { 
    width: 80px; 
    height: 80px; 
    margin-bottom: 20px; 
    animation: pulse 2s infinite ease-in-out;
}
@keyframes pulse {
    0% { opacity: 0.5; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.5; transform: scale(0.95); }
}
.status { margin-top: 20px; font-size: 0.8rem; color: var(--accent-gold); border: 1px solid var(--accent-gold); padding: 5px 10px; display: inline-block; }

/* --- Result page specific additions --- */
.home-nav-button {
    position: absolute;
    top: 15px; left: 20px;
    color: var(--text-muted); text-decoration: none;
    font-family: 'Courier New', monospace; font-size: 0.9rem; transition: 0.3s;
}
.home-nav-button:hover { color: var(--accent-gold); }

.header-container { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 20px; }
.status-icon { width: 32px; height: 32px; filter: drop-shadow(0 0 5px var(--accent-gold)); }
.success-header { color: var(--accent-gold); text-shadow: 0 0 10px rgba(245, 197, 66, 0.4); }
.fail-header { color: var(--alert-red); text-shadow: 0 0 10px rgba(255, 68, 68, 0.4); }

.stat-box { 
    display: flex; justify-content: space-between; align-items: center; 
    margin: 20px 0; padding: 20px; background: rgba(0,0,0,0.3); border: 1px solid var(--border-color);
}
.stat { text-align: center; flex: 1; }
.stat-val { font-size: 1.4rem; font-weight: bold; color: #fff; font-family: 'Courier New', monospace; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; margin-top: 5px; }
.arrow { font-size: 1.5rem; color: var(--accent-gold); animation: slide 1.5s infinite; }
@keyframes slide { 0% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 100% { transform: translateX(-5px); } }

.result-text { font-size: 1.2rem; font-weight: bold; margin-bottom: 30px; font-family: 'Courier New', monospace; }
.success { color: var(--accent-gold); }
.fail { color: var(--alert-red); }

.warning-box { background: rgba(255, 68, 68, 0.15); color: #ffffff; padding: 15px; border: 1px solid var(--alert-red); font-size: 0.85rem; text-align: left; margin-top: -10px; margin-bottom: 30px; }

.preview-container { border: 1px solid var(--border-color); background: #000; margin-bottom: 20px; display: flex; flex-direction: column; }
.preview-toolbar { background: #1a1a1a; padding: 10px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; min-height: 35px; }
.preview-title { font-family: 'Courier New', monospace; color: var(--text-muted); font-size: 0.9rem; letter-spacing: 1px; font-weight: bold; }
.toolbar-btn { background: var(--accent-gold); color: #000; text-decoration: none; padding: 5px 15px; border-radius: 2px; font-size: 0.85rem; font-weight: bold; display: flex; align-items: center; gap: 8px; transition: 0.3s; text-transform: uppercase; }
.toolbar-btn:hover { background: #ffe066; box-shadow: 0 0 10px rgba(245, 197, 66, 0.4); }
.toolbar-btn svg { width: 16px; height: 16px; }
.media-wrapper { padding: 0; background: #000; width: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.preview-media { max-width: 100%; display: block; }
iframe.preview-media { width: 100%; height: 600px; border: none; }
video.preview-media { width: 100%; max-height: 500px; }
img.preview-media { max-height: 600px; padding: 20px; box-sizing: border-box; }
audio.preview-media { width: 100%; height: 60px; padding: 20px; }
.back-link { display: inline-block; margin-top: 10px; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: 0.3s; }
.back-link:hover { color: var(--accent-gold); text-decoration: underline; }

/* Inline-to-class replacements */
.under-toolbar { margin-top: 15px; }
.inline-form { display: inline; }
.delete-button { background:none; border:none; padding:0; color:#ff4444; font-size:0.8rem; cursor:pointer; border-bottom:1px dashed #ff4444; }
.auto-delete-note { font-size: 0.7rem; color: #666; margin-top: 5px; }
.preview-unavailable { color: #666; height: 100px; display:flex; align-items:center; justify-content:center; }
