/* ============================================
   Music-Off: Premium Dark Theme
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 30, 0.65);
    --bg-card-hover: rgba(25, 25, 40, 0.8);

    --text-primary: #f0f0f5;
    --text-secondary: #9898b0;
    --text-muted: #5a5a75;

    --accent-purple: #a855f7;
    --accent-indigo: #6366f1;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-green: #34d399;
    --accent-red: #f43f5e;

    --gradient-primary: linear-gradient(135deg, #a855f7, #6366f1);
    --gradient-success: linear-gradient(135deg, #34d399, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #f43f5e, #ec4899);

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(168, 85, 247, 0.3);

    --shadow-glow: 0 0 40px rgba(168, 85, 247, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Animated Background --- */
.bg-effects {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-purple);
    top: -15%;
    right: -10%;
    animation-delay: 0s;
    opacity: 0.15;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-indigo);
    bottom: -10%;
    left: -10%;
    animation-delay: -7s;
    opacity: 0.12;
}

.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-pink);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.08;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -40px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(10px, 30px) scale(1.02);
    }
}

/* --- App Container --- */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-accent);
}

/* --- Header --- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 4px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.device-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.device-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* --- Output Section --- */
.output-section {
    padding: 20px 24px;
    margin-bottom: 20px;
}

.section-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-icon {
    font-size: 1.4rem;
}

.section-header-row h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.output-input-row {
    display: flex;
    gap: 10px;
}

.input-field {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.input-field:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.output-status {
    font-size: 0.78rem;
    margin-top: 8px;
    min-height: 20px;
}

.output-status.success {
    color: var(--accent-green);
}

.output-status.error {
    color: var(--accent-red);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(168, 85, 247, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-accent);
}

.btn-ghost {
    background: none;
    color: var(--text-muted);
    padding: 8px;
    font-size: 1.2rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

/* --- Upload Section --- */
.upload-section {
    padding: 0;
    overflow: hidden;
}

.upload-zone {
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition);
    pointer-events: none;
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
    border-color: var(--accent-purple);
    border-style: solid;
}

.upload-zone.drag-over {
    background: rgba(168, 85, 247, 0.05);
}

.upload-icon {
    width: 80px;
    height: 80px;
    color: var(--accent-purple);
    margin-bottom: 20px;
    transition: var(--transition);
}

.upload-zone:hover .upload-icon {
    transform: translateY(-5px);
    color: var(--accent-indigo);
}

.upload-zone h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-zone p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.upload-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
    justify-content: center;
}

.format-tag {
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.upload-limit {
    margin-top: 14px;
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
}

/* --- Processing Section --- */
.processing-section {
    padding: 28px;
}

.processing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.file-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.1);
    border-radius: var(--radius-sm);
}

.file-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-details {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Waveform Animation --- */
.waveform-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    margin-bottom: 24px;
}

.waveform {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 60px;
}

.wave-bar {
    width: 4px;
    border-radius: 2px;
    background: var(--gradient-primary);
    animation: wave 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    animation-delay: calc(var(--delay) * 0.07s);
    min-height: 6px;
}

@keyframes wave {

    0%,
    100% {
        height: 8px;
        opacity: 0.4;
    }

    50% {
        height: 50px;
        opacity: 1;
    }
}

.waveform-container.paused .wave-bar {
    animation-play-state: paused;
}

/* --- Progress Bar --- */
.progress-section {
    margin-bottom: 16px;
}

.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.progress-glow {
    position: absolute;
    right: 0;
    top: -4px;
    width: 30px;
    height: 14px;
    background: var(--accent-purple);
    filter: blur(8px);
    border-radius: 50%;
    opacity: 0.6;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.progress-percent {
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-message {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

/* --- Result Section --- */
.result-section {
    padding: 48px 32px;
    text-align: center;
}

.result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-icon svg {
    width: 100%;
    height: 100%;
}

.result-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-filename {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.result-path {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    word-break: break-all;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Error Section --- */
.error-section {
    padding: 48px 32px;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.error-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent-red);
}

.error-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* --- Recent Files / History Section --- */
.history-section {
    padding: 0;
    margin-top: 16px;
    overflow: hidden;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.history-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.history-header .section-icon {
    font-size: 1rem;
}

.history-header h3 {
    font-size: 0.8rem !important;
}

.history-header .section-desc {
    font-size: 0.68rem !important;
}

.history-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.history-chevron.open {
    transform: rotate(180deg);
}

.history-body {
    padding: 0 16px 12px;
    overflow: hidden;
}

.history-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.history-table thead th {
    text-align: left;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.history-table thead th:last-child {
    text-align: center;
    width: 36px;
}

.history-table thead th:nth-child(2) {
    text-align: right;
    width: 60px;
}

.history-table tbody tr {
    transition: var(--transition);
}

.history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.history-table td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    vertical-align: middle;
}

.history-table .history-cell-name {
    color: var(--text-primary);
    font-weight: 400;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.history-table .history-cell-expiry {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-align: right;
    white-space: nowrap;
}

.history-table .history-cell-expiry.expiring-soon {
    color: var(--accent-red);
    font-weight: 600;
}

.history-table .history-cell-action {
    text-align: center;
}

.history-dl-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.65rem;
    text-decoration: none;
    line-height: 1;
}

.history-dl-link:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

.history-clear-btn {
    margin-top: 6px;
    font-size: 0.65rem !important;
    width: 100%;
    color: var(--text-muted) !important;
    opacity: 0.5;
    padding: 4px !important;
}

.history-clear-btn:hover {
    opacity: 1;
    color: var(--accent-red) !important;
}

/* --- Footer --- */
.footer {
    margin-top: auto;
    padding: 24px 0 8px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .app-container {
        padding: 20px 16px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .upload-zone {
        padding: 40px 20px;
    }

    .upload-zone h2 {
        font-size: 1.1rem;
    }

    .output-input-row {
        flex-direction: column;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }

    .file-info h3 {
        max-width: 200px;
    }

    .header-controls {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ============================================
   Light Theme (Sky Blue)
   ============================================ */
[data-theme="light"] {
    --bg-primary: #eef4fb;
    --bg-secondary: #dfe9f5;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-hover: rgba(255, 255, 255, 0.9);

    --text-primary: #1a2332;
    --text-secondary: #4a5e78;
    --text-muted: #8898aa;

    --accent-purple: #0ea5e9;
    --accent-indigo: #0284c7;
    --accent-pink: #38bdf8;
    --accent-cyan: #06b6d4;
    --accent-green: #22c55e;
    --accent-red: #ef4444;

    --gradient-primary: linear-gradient(135deg, #0ea5e9, #0284c7);
    --gradient-success: linear-gradient(135deg, #22c55e, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f97316);

    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-accent: rgba(14, 165, 233, 0.3);

    --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.12);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .bg-orb {
    opacity: 0.06;
}

[data-theme="light"] .input-field {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .input-field::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: var(--border-accent);
}

[data-theme="light"] .btn-ghost:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .device-badge {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

[data-theme="light"] .format-tag {
    background: rgba(14, 165, 233, 0.08);
    color: var(--accent-purple);
    border-color: rgba(14, 165, 233, 0.2);
}

[data-theme="light"] .status-message {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .progress-bar-container {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .toggle-switch .toggle-slider {
    background: #c4d1de;
}

[data-theme="light"] .toggle-switch input:checked+.toggle-slider {
    background: var(--accent-purple);
}

/* ============================================
   Header Controls (Theme + Language)
   ============================================ */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-accent);
    transform: rotate(15deg);
}

[data-theme="light"] .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.07);
}

.lang-select {
    appearance: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 7px 28px 7px 12px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239898b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.lang-select:hover {
    border-color: var(--border-accent);
}

.lang-select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.lang-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="light"] .lang-select {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5e78' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="light"] .lang-select option {
    background: white;
    color: var(--text-primary);
}

/* ============================================
   FFmpeg Settings Section
   ============================================ */
.ffmpeg-section {
    padding: 20px 24px;
    margin-bottom: 20px;
}

.ffmpeg-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ffmpeg-toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.ffmpeg-manual-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.ffmpeg-status {
    font-size: 0.78rem;
    margin-top: 8px;
    min-height: 20px;
}

.ffmpeg-status.success {
    color: var(--accent-green);
}

.ffmpeg-status.error {
    color: var(--accent-red);
}

/* --- Toggle Switch --- */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--gradient-primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* ============================================
   RTL Support
   ============================================ */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .header {
    flex-direction: row-reverse;
}

[dir="rtl"] .logo {
    flex-direction: row-reverse;
}

[dir="rtl"] .output-input-row,
[dir="rtl"] .ffmpeg-manual-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .section-header-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .file-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .processing-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .device-badge {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-controls {
    flex-direction: row-reverse;
}

[dir="rtl"] .ffmpeg-toggle-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .progress-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-select {
    padding: 7px 12px 7px 28px;
    background-position: left 10px center;
}

[dir="rtl"] .toggle-slider::before {
    left: auto;
    right: 3px;
}

[dir="rtl"] .toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(-20px);
}

@media (max-width: 600px) {
    [dir="rtl"] .header {
        align-items: flex-end;
    }

    [dir="rtl"] .output-input-row,
    [dir="rtl"] .ffmpeg-manual-row {
        flex-direction: column;
    }
}