/* 
   BATCH SUBTITLE EDITOR - EXPERT WEB TOOLS
   Theme: 2026 Glassmorphism (Mobile Anti-Scroll)
*/

@font-face { font-family: 'Inter'; src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('/fonts/orbitron-v35-latin-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('/fonts/roboto-mono-v31-latin-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
    --bg-dark: #0a0a0f;
    --primary-accent: #3b82f6;
    --secondary-accent: #8b5cf6;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --card-bg: rgba(25, 25, 35, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(0, 0, 0, 0.3);
    
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'Roboto Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* CRITICAL MOBILE FIX: Lock overflow to prevent horizontal stretching */
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body { background-color: var(--bg-dark); color: var(--text-main); font-family: var(--font-body); min-height: 100vh; display: flex; flex-direction: column; }
.background-glow { position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle at center, rgba(59, 130, 246, 0.08) 0%, rgba(10, 10, 15, 0) 50%); z-index: -1; pointer-events: none; }

/* --- Header --- */
.tool-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 5%; max-width: 1400px; margin: 0 auto; width: 100%; }
.back-btn { color: var(--text-muted); text-decoration: none; display: flex; align-items: center; gap: 8px; transition: color 0.3s; }
.back-btn:hover { color: var(--primary-accent); }
.logo { font-family: var(--font-heading); font-size: 1.2rem; }
.logo span { color: var(--primary-accent); }

/* --- Main Layout --- */
.main-content { flex-grow: 1; padding: 2rem 5%; max-width: 1200px; margin: 0 auto; width: 100%; }
.tool-intro { text-align: center; margin-bottom: 2rem; }
.tool-intro h1 { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 0.5rem; }
.tool-intro p { color: var(--text-muted); }

.tool-layout { display: grid; grid-template-columns: 400px 1fr; gap: 2rem; align-items: start; width: 100%; }

.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 1.5rem; backdrop-filter: blur(10px); width: 100%; }
.card-header { margin-bottom: 1.5rem; border-bottom: 1px solid var(--card-border); padding-bottom: 1rem; }
.card-header h2 { font-family: var(--font-heading); font-size: 1.1rem; display: flex; align-items: center; gap: 10px; margin: 0; color: #fff;}
.card-header i { color: var(--secondary-accent); }

/* Upload Panel */
.upload-panel { display: flex; flex-direction: column; height: 100%; }
.drop-zone { border: 2px dashed var(--card-border); padding: 3rem 1rem; text-align: center; cursor: pointer; transition: all 0.2s; margin-bottom: 1.5rem; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary-accent); background: rgba(59, 130, 246, 0.05); }
.upload-icon { font-size: 3rem; color: var(--secondary-accent); margin-bottom: 1rem; }
.drop-zone h3 { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 5px; }
.drop-zone p { color: var(--text-muted); font-size: 0.9rem; }

.queue-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.queue-header h3 { font-family: var(--font-heading); font-size: 1rem; display: flex; align-items: center; gap: 10px;}
.badge { background: rgba(59, 130, 246, 0.2); color: #93c5fd; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; }

.queue-list { display: flex; flex-direction: column; gap: 8px; max-height: 500px; overflow-y: auto; }
.empty-state { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-top: 1rem; font-style: italic; }

.file-item { background: rgba(0,0,0,0.3); border: 1px solid var(--card-border); padding: 10px 15px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.file-name { color: #cbd5e1; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; font-family: var(--font-code);}
.file-item.processed .file-name { color: #10b981; }

.icon-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; transition: color 0.2s; padding: 5px; }
.icon-btn:hover { color: #fff; }
.icon-btn.danger:hover { color: #ef4444; }

/* Actions Panel */
.actions-panel { display: flex; flex-direction: column; gap: 1.5rem; }
.action-card { padding: 1.5rem; }

.action-group { margin-bottom: 1.5rem; }
.action-group:last-child { margin-bottom: 0; }
.action-group label { display: block; font-size: 0.95rem; color: var(--text-main); margin-bottom: 8px;}

.toggle-checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle-checkbox input { accent-color: var(--primary-accent); cursor: pointer; width: 16px; height: 16px; }

.settings-box { background: rgba(0,0,0,0.3); border: 1px solid var(--card-border); padding: 1rem; border-radius: 8px; margin-top: 10px; animation: slideDown 0.2s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

input[type="text"], input[type="number"], select {
    width: 100%; background: var(--input-bg); border: 1px solid var(--card-border);
    color: #fff; padding: 10px; border-radius: 6px; outline: none; font-family: var(--font-body); font-size: 0.95rem;
}
input:focus, select:focus { border-color: var(--primary-accent); }
select option { background: var(--bg-dark); }
.hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }

.input-row { display: flex; align-items: center; gap: 10px; }
.input-row i { color: var(--text-muted); }
.input-row span { color: var(--text-muted); font-size: 0.9rem;}

.execution-panel { text-align: center; margin-top: 1rem; }
.primary-btn { background: var(--primary-accent); color: #fff; border: none; padding: 14px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 1rem; transition: background 0.2s; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.primary-btn:hover:not(:disabled) { background: #2563eb; }
.primary-btn:disabled { background: #475569; cursor: not-allowed; opacity: 0.7; }

.progress-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin-top: 15px;}
.progress-fill { height: 100%; width: 0%; background: #10b981; transition: width 0.3s; }
.status-msg { font-size: 0.85rem; color: var(--text-muted); margin-top: 5px; font-style: italic;}

/* Utilities */
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.mt-1 { margin-top: 1rem; }

/* Toast */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1e1e24; border: 1px solid var(--primary-accent); color: #fff; padding: 10px 20px; border-radius: 8px; z-index: 2000; box-shadow: 0 4px 12px rgba(0,0,0,0.5); transition: opacity 0.3s; font-size: 0.9rem; pointer-events: none;}

/* Info Section */
.info-section { margin-top: 4rem; padding: 0 1rem; width: 100%; }
.info-section h2 { font-family: var(--font-heading); color: var(--text-main); margin-bottom: 2rem; font-size: 1.5rem; text-align: center; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.info-grid h3 { color: var(--primary-accent); font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 0.5rem; }
.info-grid i { margin-right: 8px; }
.info-grid p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

.faq-container { margin-top: 2rem; }
.faq-container h3 { font-family: var(--font-heading); color: var(--text-main); margin: 1.5rem 0 1rem; }
.faq-container h4 { color: var(--secondary-accent); font-size: 1rem; margin-bottom: 0.5rem; margin-top: 1.5rem; }
.faq-container p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1rem; line-height: 1.6; }
.seo-link { color: var(--primary-accent); text-decoration: none; border-bottom: 1px dotted var(--primary-accent); transition: 0.2s;}
.seo-link:hover { color: #93c5fd; border-bottom-style: solid; }

footer { text-align: center; padding: 3rem 0; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--card-border); margin-top: 3rem; }
footer a { color: #fff; text-decoration: none; }

/* Responsive */
@media (max-width: 900px) {
    .tool-layout { grid-template-columns: 1fr; }
    .upload-panel { order: -1; } /* Upload block stays on top */
    .file-name { max-width: 70vw; }
}
@media (max-width: 600px) {
    .tool-header, .main-content { padding: 1.5rem 1rem; }
    .card { padding: 1.25rem; }
    .drop-zone { padding: 2rem 1rem; }
}