﻿/* ==========================================================================
   WEBP to JPG Converter - CSS Stylesheet
   Author: WebVK
   ========================================================================== */

/* --- Design Tokens --- */
:root {
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', Courier, monospace;

    /* Charcoal Dark Mode Palette by default (matching premium uploader style) */
    --bg-app: #12161a;
    --bg-surface: #1e242b;
    --bg-surface-alt: #242d36;
    --bg-header: rgba(18, 22, 26, 0.85);
    
    --border-color: #2e3b48;
    --border-color-hover: #3e4f60;
    --border-color-focus: #e11d48;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    
    --primary: #e11d48; /* Red Accent */
    --primary-hover: #be123c;
    --primary-light: rgba(225, 29, 72, 0.15);
    
    --success: #10b981;
    --success-hover: #059669;
    --success-light: rgba(16, 185, 129, 0.15);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(225, 29, 72, 0.25);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition-fast: 0.12s ease;
    --transition-normal: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme overrides */
[data-theme="light"] {
    --bg-app: #f4f6f8;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f8fafc;
    --bg-header: rgba(244, 246, 248, 0.85);
    
    --border-color: #cbd5e1;
    --border-color-hover: #94a3b8;
    --border-color-focus: #e11d48;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #64748b;
    
    --primary-light: #fff1f2;
    --success-light: #d1fae5;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-glow: 0 0 20px rgba(225, 29, 72, 0.15);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-normal);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-hover);
}

/* --- Layout --- */
.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    z-index: 100;
    transition: border-color var(--transition-normal);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    height: 52px;
    width: auto;
    border-radius: var(--radius-sm);
    display: block;
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 1px;
}

.logo-separator {
    color: var(--text-light);
    font-weight: 600;
}

.logo-tool-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-item-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}
.nav-item-link:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
    background-color: var(--bg-surface-alt);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    gap: 8px;
    outline: none;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-red {
    background-color: var(--primary);
    color: #ffffff;
}
.btn-red:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-surface-alt);
    border-color: var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--border-color-hover);
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}
.btn-success:hover {
    background-color: var(--success-hover);
    transform: translateY(-1px);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    border-color: var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-muted);
}
.btn-icon:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
    border-color: var(--border-color);
    background-color: var(--bg-surface-alt);
    color: var(--text-muted);
}
.btn-icon-sm:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
}

.btn-arrow {
    font-size: 0.8rem;
    opacity: 0.8;
}

.btn-glow {
    box-shadow: var(--shadow-glow);
}

/* --- Hero Section --- */
.hero-section {
    padding: 40px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto;
}

/* Format Diagram Widget */
.format-widget {
    display: flex;
    align-items: center;
    gap: 15px;
}

.format-badge {
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
}

.format-webp {
    background-color: #0284c7;
    color: #ffffff;
}

.format-jpg {
    background-color: #f59e0b;
    color: #ffffff;
}

.format-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
}
.format-arrow i {
    width: 20px;
    height: 20px;
}
.arrow-text {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* --- Converter Workspace --- */
.converter-workspace {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Uploader Card */
.uploader-card {
    background-color: #ffffff; /* White background uploader card, mimics cloudconvert */
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 45px 20px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}
[data-theme="dark"] .uploader-card {
    background-color: #1a2026;
}

.uploader-card:hover, .uploader-card.drag-over {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.uploader-inner {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.uploader-icon-bg {
    background-color: var(--primary-light);
    color: var(--primary);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.uploader-icon {
    width: 32px;
    height: 32px;
}

.uploader-card h3 {
    color: #0f172a; /* Dark text for contrast inside the white card */
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
}
[data-theme="dark"] .uploader-card h3 {
    color: #f1f5f9;
}

.uploader-sub {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* Settings Card */
.settings-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}
.settings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.settings-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
}
.settings-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.setting-item label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}
.badge-value {
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
}

.setting-desc {
    font-size: 0.78rem;
    color: var(--text-light);
}

/* Slider CSS */
#quality-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
}
#quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(225, 29, 72, 0.4);
    transition: transform 0.1s;
}
#quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Resize Inputs */
.resize-inputs-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.num-input-wrapper {
    flex: 1;
}
.num-input-wrapper input {
    width: 100%;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface-alt);
    color: var(--text-main);
    padding: 0 10px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--transition-fast);
}
.num-input-wrapper input:focus {
    border-color: var(--primary);
}

.resize-x {
    color: var(--text-light);
    font-weight: 600;
}

/* Controls Action panel */
.control-actions-panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.actions-right {
    display: flex;
    gap: 10px;
}

/* Queue Card */
.queue-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}

.queue-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Queue Item card */
.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    gap: 16px;
}

.item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.item-icon {
    color: var(--text-light);
    flex-shrink: 0;
}

.item-details {
    min-width: 0;
}
.item-name {
    font-size: 0.9rem;
    font-weight: 600;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.item-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    gap: 8px;
}

.item-center {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
}

.progress-track {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.1s ease;
}
.progress-fill.success {
    background-color: var(--success);
}

.progress-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    text-align: right;
}

.item-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.badge-savings {
    background-color: var(--success-light);
    color: var(--success);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
}

/* --- SEO & FAQ Section --- */
.seo-content-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

.seo-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
}

.seo-guide h2 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.seo-guide > p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.bullet-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.bullet-item {
    display: flex;
    gap: 15px;
}
.bullet-num {
    background-color: var(--primary-light);
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bullet-num i {
    width: 18px;
    height: 18px;
}
.bullet-body h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 3px;
}
.bullet-body p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.seo-faqs h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 20px;
}

/* FAQ Accordion */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.accordion-trigger {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-surface-alt);
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    gap: 15px;
}
.accordion-trigger:hover {
    background-color: var(--border-color);
}
.accordion-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition-normal);
}
.accordion-item.active .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    background-color: var(--bg-surface);
}
.accordion-content p {
    padding: 16px 20px;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}
.accordion-item.active .accordion-content {
    max-height: 200px;
}

/* --- Footer --- */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-brand {
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.footer-brand:hover {
    text-decoration: underline;
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-links a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* --- Toast Container --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}
.toast {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    min-width: 240px;
}
.toast-success {
    border-left: 4px solid var(--success);
}
.toast-success i {
    color: var(--success);
}
.toast-danger {
    border-left: 4px solid var(--danger);
}
.toast-danger i {
    color: var(--danger);
}

@keyframes toast-slide-in {
    from {
        transform: translateY(20px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}
.toast-fade-out {
    animation: toast-slide-out 0.25s ease forwards;
}
@keyframes toast-slide-out {
    to {
        transform: translateY(10px);
        opacity: 0;
    }
}

/* --- Responsive Layouts --- */
@media (max-width: 850px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .seo-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .hero-title {
        font-size: 2.1rem;
    }
    .control-actions-panel {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .actions-right {
        flex-direction: column;
    }
    .btn {
        width: 100%;
    }
    .queue-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .item-right {
        justify-content: space-between;
    }
    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* Nav dropdown styles added */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.btn-dropdown {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dropdown-chevron {
    width: 14px;
    height: 14px;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 200px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 500;
}
.dropdown-item-link {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}
.dropdown-item-link:hover {
    color: var(--text-main);
    background-color: var(--bg-surface-alt);
}
.nav-dropdown:hover .dropdown-menu {
    display: block;
}
