/* 
   IMAGE CONVERTER - EXPERT WEB TOOLS
   Theme: 2025 Glassmorphism (Dropdown Fix)
*/

/* --- Fonts --- */
@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(255, 255, 255, 0.05);
    
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'Roboto Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--card-border);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card-bg);
}
.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.2rem; margin-bottom: 5px; }
.drop-zone p { color: var(--text-muted); font-size: 0.9rem; }

/* Tool Layout (Sidebar + Queue) */
.tool-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Settings Panel */
.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.card-header {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.card-header i { color: var(--primary-accent); margin-right: 8px; }

/* Controls */
select, input[type="text"], input[type="number"] {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    font-family: var(--font-body);
}
select:focus, input:focus { border-color: var(--primary-accent); }

/* DROPDOWN FIX START */
select option {
    background-color: var(--bg-dark);
    color: #fff;
    padding: 10px;
    font-family: var(--font-body);
}
/* DROPDOWN FIX END */

.label-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-muted); }

input[type="range"] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--primary-accent);
}

.toggle-switch {
    display: flex;
    background: rgba(0,0,0,0.3);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}
.toggle-btn.active { background: var(--primary-accent); color: #fff; }

.input-row { display: flex; align-items: center; gap: 8px; }
.x-sep { color: var(--text-muted); }

.checkbox-wrapper { font-size: 0.9rem; color: var(--text-muted); display: flex; align-items: center; }
.checkbox-wrapper input { margin-right: 8px; cursor: pointer; accent-color: var(--primary-accent); }

.dims-preview { margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); text-align: center; }
#output-dims-display { color: var(--primary-accent); font-weight: bold; }

/* Switch Slider */
.switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #4b5563; transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-accent); }
input:checked + .slider:before { transform: translateX(14px); }

.watermark-controls { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--card-border); }
.preview-btn { width: 100%; background: transparent; border: 1px solid var(--card-border); color: var(--text-muted); padding: 8px; border-radius: 6px; cursor: pointer; }
.preview-btn:hover { border-color: var(--primary-accent); color: #fff; }

/* Queue Panel */
.queue-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.queue-header h2 { font-family: var(--font-heading); font-size: 1.2rem; margin: 0; }

.queue-actions { display: flex; gap: 10px; }
.secondary-btn, .danger-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
.secondary-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }
.danger-btn:hover { border-color: #ef4444; color: #ef4444; }

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.image-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.img-preview-box { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; background: #000; flex-shrink: 0; }
.image-card-thumb { width: 100%; height: 100%; object-fit: cover; }

.image-info { flex-grow: 1; min-width: 0; }
.file-name { color: #fff; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.file-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.file-meta i { font-size: 0.7rem; }

.card-actions { display: flex; align-items: center; gap: 10px; }
.status-badge { font-size: 0.75rem; background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 4px; color: var(--text-muted); }
.status-badge[data-status="done"] { background: rgba(16, 185, 129, 0.2); color: #10b981; }

.icon-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
.icon-btn:hover { color: #fff; }
.remove-btn:hover { color: #ef4444; }

.main-actions { margin-top: auto; }
.primary-btn {
    width: 100%;
    background: var(--primary-accent);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}
.primary-btn:hover:not(:disabled) { background: #2563eb; }
.primary-btn:disabled { background: #4b5563; cursor: not-allowed; opacity: 0.7; }

/* Progress Bar */
.progress-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin-bottom: 1rem; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: #10b981; transition: width 0.3s; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.modal-box {
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    padding: 2rem;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    text-align: center;
}
.modal-box h3 { font-family: var(--font-heading); margin-bottom: 1rem; }
.modal-box canvas { max-width: 100%; border: 1px solid var(--card-border); }
.close-btn { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }

.hidden { display: none !important; }
.mt-1 { margin-top: 1rem; }

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; }

@media (max-width: 900px) {
    .tool-layout { grid-template-columns: 1fr; }
    .settings-panel { order: 2; }
    .queue-panel { order: 1; }
}