/* --- GLOBAL VARIABLES --- */
:root {
    --bg-color: #050505;
    --card-bg: #121212;
    --text-main: #e0e0e0;
    --text-muted: #888888;
    --accent-gold: #f5c542;
    --accent-dark: #b8860b;
    --alert-red: #ff4444;
    --neon-green: #00ff41;
    --border-color: #333333;
    --toolbar-bg: #1a1a1a;
}

body { 
    font-family: 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif; 
    text-align: center; 
    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;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1; /* Pushes footer down */
    padding: 40px 20px;
}

a { text-decoration: none; color: inherit; }

/* --- CARD COMPONENT --- */
.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;
    text-align: left; /* Reset text align for form elements */
}

/* Result Card is wider */
.card.wide { max-width: 900px; padding: 40px; text-align: center; }

.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 (Now part of Layout and responsive) --- */
.site-header {
    padding: 30px 20px;
    background: linear-gradient(180deg, rgba(245, 197, 66, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
    
    /* FORCE VERTICAL STACKING */
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    gap: 15px; /* Space between Logo layer and Status layer */
}

.logo-container { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    text-decoration: none;
    transition: transform 0.2s;
    /* Ensure logo stays centered if screen is tiny */
    justify-content: center;
    flex-wrap: wrap; 
}

.logo-container:hover { transform: scale(1.02); }

.custom-logo { width: 60px; height: 60px; filter: drop-shadow(0 0 5px var(--accent-gold)); }

.header-title { 
    margin: 0; 
    font-size: 2rem; /* Made slightly bigger since it has its own row now */
    font-weight: 300; 
    letter-spacing: 3px; 
    text-transform: uppercase; 
    color: var(--accent-gold); 
    text-shadow: 0 0 10px rgba(245, 197, 66, 0.3);
    text-align: center;
}

/* Stats Bar - Centered on its own row */
.stats-bar { 
    background: rgba(0, 0, 0, 0.6); 
    padding: 8px 20px; 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    border: 1px solid var(--border-color); 
    border-radius: 4px; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Courier New', monospace; 
    backdrop-filter: blur(5px);
    width: auto; /* Let it shrink to fit content */
}

.stats-val { font-weight: bold; color: var(--accent-gold); }
.stats-offline { color: var(--alert-red); font-weight: bold; animation: blink 1.5s infinite; }
.stats-online { color: var(--neon-green); 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; } }

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 20px;
    }
    
    .header-title { font-size: 1.2rem; }
    
    .stats-bar {
        font-size: 0.75rem;
        width: 100%;
        justify-content: center;
    }
    
    .card { max-width: 95%; margin: 10px auto; }
    
    /* Footer Mobile Stack */
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 30px; }
    .footer-col h4 { border-left: none; padding-left: 0; border-bottom: 2px solid var(--accent-gold); display: inline-block; padding-bottom: 5px;}
    .footer-brand p { margin: 15px auto; } /* Center text */

    /* Stack the bottom copyright text on mobile */
    .footer-bottom-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        align-items: center;
    }
}

/* --- FOOTER (Cyberpunk / AdGuard Style) --- */
.site-footer {
    background-color: #0a0a0a;
    border-top: 1px solid var(--border-color);
    padding: 40px 20px 20px;
    margin-top: auto;
    font-size: 0.9rem;
    text-align: left;
    box-sizing: border-box;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    max-width: 1100px;
    margin: 0 auto;
    gap: 40px;
}

.footer-col h4 {
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    font-size: 1rem;
    border-left: 3px solid var(--accent-gold);
    padding-left: 10px;
}

.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { color: var(--text-muted); transition: 0.3s; }
.footer-col a:hover { color: var(--accent-gold); text-shadow: 0 0 5px var(--accent-gold); }

.footer-brand p { color: var(--text-muted); line-height: 1.6; margin-top: 15px; max-width: 300px; }
.footer-brand .mini-logo { width: 30px; vertical-align: middle; margin-right: 10px; }

.footer-bottom {
    width: 100%;             /* Span full container width */
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #222;
}

.footer-bottom-inner {
    max-width: 1100px;       
    margin: 0 auto;          
    display: flex;
    justify-content: space-between;
    color: #555;
    font-size: 0.8rem;
}

/* --- TABS --- */
.tabs { display: flex; background: #000; border-bottom: 1px solid var(--border-color); }
.tab { 
    flex: 1; 
    padding: 10px; 
    font-weight: 500; 
    color: var(--text-muted); 
    cursor: pointer; 
    transition: 0.3s; 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    text-align: center;
    
    /* NEW: Reset Button Styles */
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent; /* Keep bottom border logic */
    border-radius: 0;
    font-family: inherit; /* Use site font, not system UI font */
    appearance: none;
    -webkit-appearance: none;
}
.tab:hover { color: var(--accent-gold); background: transparent !important; box-shadow: none !important; }
.tab.active { color: var(--accent-gold); background: transparent !important; border-bottom: 2px solid var(--accent-gold); border: none !important; box-shadow: none !important; }
/* Ensure tab contents still fade in correctly */
.tab-content { display: none; padding: 30px 30px; }
.tab-content.active { display: block; animation: fadeIn 0.4s; }

/* --- FORMS & INPUTS --- */
label { font-weight: bold; display: block; margin-top: 10px; margin-bottom: 8px; color: var(--text-main); font-size: 0.9rem; }
select, input[type="file"], 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); }

input[type="file"]::file-selector-button {
    background-color: #000; color: var(--accent-gold); border: 1px solid var(--accent-gold);
    border-right: 1px solid var(--accent-gold); padding: 8px 15px; margin-right: 15px;
    border-radius: 2px; cursor: pointer; font-family: 'Courier New', monospace;
    font-weight: bold; transition: 0.3s; text-transform: uppercase;
}
input[type="file"]::file-selector-button:hover {
    background-color: var(--accent-gold); color: #000; box-shadow: 0 0 10px rgba(245, 197, 66, 0.4);
}

/* --- CYBERPUNK DROP ZONE --- */
.drop-zone {
    width: 100%;
    height: 150px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    transition: 0.3s ease;
    margin-bottom: 10px;
    overflow: hidden;
    box-sizing: border-box; /* Ensures padding doesn't break width */
}

/* --- DISABLED STATE FOR DROPZONE --- */
.drop-zone.locked {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    border-color: #555;
    background: rgba(0,0,0,0.5);
}

/* Hover & Drag State */
.drop-zone:hover, .drop-zone.drop-zone--over {
    border-color: var(--accent-gold);
    background: rgba(245, 197, 66, 0.05);
    box-shadow: inset 0 0 20px rgba(245, 197, 66, 0.1);
}

/* The actual file input (Invisible but clickable) */
.drop-zone__input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* The Prompt Text & Icon Container */
.drop-zone__prompt {
    z-index: 1;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    pointer-events: none;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* --- THE FIX IS HERE: Constrain Icon Size --- */
.upload-icon {
    width: 50px;   /* Forces icon to be small */
    height: 50px;  /* Forces icon to be small */
    stroke: var(--text-muted);
    transition: 0.3s;
    margin-bottom: 5px;
}

.drop-zone:hover .drop-zone__prompt { color: var(--accent-gold); }

.drop-zone:hover .upload-icon {
    stroke: var(--accent-gold);
    filter: drop-shadow(0 0 5px var(--accent-gold));
}

/* File Selected State */
.drop-zone.has-file {
    border-style: solid;
    border-color: var(--neon-green);
    background: rgba(0, 255, 65, 0.05);
}
.drop-zone.has-file .upload-icon { stroke: var(--neon-green); }
.drop-zone.has-file .drop-zone__prompt { color: var(--neon-green); }

/* --- BUTTONS --- */
button, .btn-download { 
    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;
    display: flex; justify-content: center; align-items: center; gap: 10px;
}
button:hover, .btn-download: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; }
.btn-download { background: var(--accent-gold); color: #000; border: none; margin-top: 0; }

.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); }

/* --- PROGRESS & TARGETS --- */
.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;
}
.processing-timer { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; margin-bottom: 15px; font-family: 'Courier New', monospace; }
@keyframes progress-bar-stripes { 0% { background-position: 20px 0; } 100% { background-position: 0 0; } }

.target-wrapper { margin-top: 0px; padding: 15px; border: 1px dashed var(--border-color); background: rgba(255,255,255,0.02); }
.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; }
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; }
input.target-number { width: 80px; text-align: center; color: var(--accent-gold); font-weight: bold; }

/* --- HELPERS --- */
.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; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- RESULT PAGE SPECIFICS --- */
.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); } }

.preview-container { border: 1px solid var(--border-color); background: #000; margin-bottom: 20px; }
.preview-toolbar { background: var(--toolbar-bg); 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); }
.media-wrapper { background: #000; width: 100%; display: flex; justify-content: 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; }
.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; }
.result-text.fail { font-size: 1.2rem; font-weight: bold; margin-bottom: 20px; font-family: 'Courier New', monospace; color: var(--alert-red); }
.result-text.success { font-size: 1.2rem; font-weight: bold; margin-bottom: 20px; font-family: 'Courier New', monospace; color: var(--accent-gold); }
.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; }

/* 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 pulse-text {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}
.pulse-animation {
    animation: pulse-text 1.5s infinite;
}