/**
 * Proxutil Video to Audio Converter & Audio Hub Stylesheet
 * Refined Paper & Modern Indigo/Emerald Palette
 */

:root {
    /* Color Palette */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-subtle: #f1f5f9;
    --bg-surface-hover: #e2e8f0;
    --border-color: #e2e8f0;
    --border-focus: #4f46e5;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-text: #3730a3;
    
    --accent-emerald: #0d9488;
    --accent-emerald-light: #ccfbf1;
    --accent-emerald-text: #115e59;
    
    --accent-amber: #d97706;
    --accent-amber-light: #fef3c7;
    --accent-amber-text: #92400e;

    --accent-rose: #e11d48;
    --accent-rose-light: #ffe4e6;
    --accent-rose-text: #9f1239;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #0f172a;
        --bg-surface: #1e293b;
        --bg-surface-subtle: #334155;
        --bg-surface-hover: #475569;
        --border-color: #334155;
        --border-focus: #818cf8;

        --text-main: #f8fafc;
        --text-muted: #94a3b8;
        --text-subtle: #64748b;

        --primary: #6366f1;
        --primary-hover: #4f46e5;
        --primary-light: rgba(99, 102, 241, 0.15);
        --primary-text: #c7d2fe;

        --accent-emerald: #14b8a6;
        --accent-emerald-light: rgba(20, 184, 166, 0.15);
        --accent-emerald-text: #5eead4;

        --accent-amber: #f59e0b;
        --accent-amber-light: rgba(245, 158, 11, 0.15);
        --accent-amber-text: #fcd34d;

        --accent-rose: #f43f5e;
        --accent-rose-light: rgba(244, 63, 94, 0.15);
        --accent-rose-text: #fda4af;

        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* Standard Proxutil Site Header */
.site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.masthead {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark-link {
    flex: 0 0 auto;
    line-height: 0;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.brand-mark-link:hover {
    transform: scale(1.06);
}

.brand-mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--text-main);
    font-size: 1.35rem;
    line-height: 1;
}

.brand-copy {
    min-width: 0;
}

.brand-copy h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.brand-copy .subtitle {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.3;
}

.header-actions {
    flex: 0 0 auto;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-subtle);
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.btn-home:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-surface);
    transform: translateY(-1px);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-local {
    background-color: var(--accent-emerald-light);
    color: var(--accent-emerald-text);
}

.badge-neutral {
    background-color: var(--bg-surface-subtle);
    color: var(--text-muted);
}

.badge-amber {
    background-color: var(--accent-amber-light);
    color: var(--accent-amber-text);
}

.badge-rose {
    background-color: var(--accent-rose-light);
    color: var(--accent-rose-text);
}

.trust-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin-top: 12px;
}

.trust-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-surface-subtle);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.trust-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
}

/* Main Card */
.main-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 36px 32px;
    margin-bottom: 32px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.card-desc {
    margin-top: 8px;
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Settings Panel */
.settings-panel {
    margin-top: 24px;
    margin-bottom: 18px;
    padding: 20px 22px;
    background-color: var(--bg-surface-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.settings-title {
    font-size: 1.02rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
}

/* Compact Dropzone (Placed below settings) */
.dropzone {
    margin-top: 0;
    margin-bottom: 20px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface);
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.drag-active {
    border-color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.dropzone-icon {
    font-size: 2.2rem;
    margin-bottom: 6px;
    line-height: 1;
}

.dropzone-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.dropzone-hint {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-select, .form-input {
    padding: 9px 12px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease;
}

.form-select:focus, .form-input:focus {
    border-color: var(--border-focus);
}

.form-checkbox-box {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 12px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease;
}

.form-checkbox-box:hover {
    border-color: var(--primary);
}

.form-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    margin: 0;
    user-select: none;
    width: 100%;
}

.form-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Action Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: var(--bg-surface);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-surface-hover);
    border-color: var(--text-subtle);
}

.btn-emerald {
    background-color: var(--accent-emerald);
    color: #ffffff;
}

.btn-emerald:hover:not(:disabled) {
    background-color: #0f766e;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.btn-icon {
    padding: 6px 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    color: var(--accent-rose);
    background: var(--accent-rose-light);
}

/* Queue / Batch List */
.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 28px 0 16px;
}

.queue-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.queue-actions {
    display: flex;
    gap: 8px;
}

.batch-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.batch-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

/* 1. Header Row */
.batch-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.batch-file-icon {
    font-size: 1.7rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.batch-file-main {
    flex: 1;
    min-width: 0;
}

.batch-file-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    word-break: break-all;
    line-height: 1.4;
}

.batch-file-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.meta-tag {
    color: var(--text-muted);
    font-weight: 500;
}

.btn-del-item {
    padding: 6px 10px;
    font-size: 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    margin-left: 8px;
}

.btn-del-item:hover {
    color: var(--accent-rose);
    background: var(--accent-rose-light);
}

/* 2. Body Settings & Action Row */
.batch-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    padding: 12px 14px;
    background: var(--bg-surface-subtle);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.batch-track-box {
    flex: 1;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.batch-action-box {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.batch-format-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.track-select {
    width: 100%;
    font-size: 0.86rem;
    padding: 7px 12px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
}

.format-select {
    min-width: 120px;
    font-size: 0.86rem;
    padding: 7px 12px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-weight: 600;
}

.batch-buttons-group {
    display: flex;
    gap: 8px;
}

.btn-convert-item {
    padding: 7px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--radius-md);
}

/* 3. Progress wrap */
.batch-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 4px;
}

/* Progress bar inside card */
.item-progress-track {
    width: 100%;
    height: 6px;
    background-color: var(--bg-surface-subtle);
    border-radius: 9999px;
    overflow: hidden;
}

.item-progress-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.2s ease;
}

.item-progress-fill.completed {
    background-color: var(--accent-emerald);
}

.item-status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Player Mini Bar */
.mini-player-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.mini-audio {
    height: 32px;
    flex: 1;
}

/* Informational & Guide Sections (Collapsible Details) */
.info-section {
    margin-top: 24px;
}

.collapsible-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 22px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.collapsible-section:hover {
    border-color: var(--primary-light);
}

.collapsible-section[open] {
    padding-bottom: 22px;
    box-shadow: var(--shadow-sm);
}

.collapsible-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 1.12rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.collapsible-chevron {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.collapsible-section[open] .collapsible-chevron {
    transform: rotate(180deg);
}

.collapsible-content {
    margin-top: 20px;
    border-top: 1px dashed var(--border-color);
    padding-top: 18px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    list-style: none;
}

.step-card {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    border-top: 4px solid var(--primary);
}

.step-num {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.step-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.step-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* FAQ List */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
}

.faq-question {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.faq-answer {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Footer */
.site-footer {
    text-align: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-subtle);
}

/* Responsive */
@media (max-width: 640px) {
    .masthead {
        padding: 12px 16px;
        gap: 10px;
    }
    .brand-lockup {
        gap: 10px;
    }
    .brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 1.15rem;
    }
    .brand-copy h1 {
        font-size: 1.05rem;
        line-height: 1.2;
    }
    .brand-copy .subtitle {
        display: none !important;
    }
    .btn-home {
        padding: 6px 12px;
        font-size: 0.82rem;
        gap: 4px;
        min-height: 32px;
    }
    .container {
        padding: 16px 12px 40px;
    }
    .main-card {
        padding: 24px 16px;
    }
    .card-title {
        font-size: 1.4rem;
    }
    .batch-card-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .batch-card-controls {
        width: 100%;
        justify-content: space-between;
    }
    .queue-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .queue-actions {
        width: 100%;
    }
    .queue-actions button {
        flex: 1;
    }
}

@media (max-width: 380px) {
    .brand-copy h1 {
        font-size: 0.95rem;
    }
    .btn-home {
        padding: 5px 10px;
        font-size: 0.78rem;
    }
}

