/* ============================================
   JXL to JPG Converter - Stylesheet
   Multi-file support with thumbnail row
   Color Theme: Blue (#3399cc)
   ============================================ */

/* Tool Container */
.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 15px 40px;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.tool-icon-wrapper {
    width: 56px;
    height: 56px;
    background: #3399cc;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(51, 153, 204, 0.3);
}

[data-theme="dark"] .tool-icon-wrapper {
    background: #5cb8e6;
    box-shadow: 0 4px 15px rgba(92, 184, 230, 0.3);
}

.tool-icon-wrapper svg {
    width: 28px;
    height: 28px;
}

.tool-title {
    font-size: 2rem;
    font-weight: 700;
    color: #3399cc;
    margin: 0;
}

[data-theme="dark"] .tool-title {
    color: #5cb8e6;
}

.tool-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

.tool-description a {
    color: #3399cc;
    text-decoration: none;
    font-weight: 500;
}

[data-theme="dark"] .tool-description a {
    color: #5cb8e6;
}

.tool-description a:hover {
    text-decoration: underline;
}

/* Main Tool Area */
.tool-main {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
}

/* Upload Section */
.upload-section {
    padding: 30px;
}

.upload-area {
    background: var(--card-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(51, 153, 204, 0.03);
    opacity: 0;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] .upload-area::before {
    background: rgba(92, 184, 230, 0.05);
}

.upload-area:hover {
    border-color: #3399cc;
    box-shadow: 0 8px 25px rgba(51, 153, 204, 0.15);
}

[data-theme="dark"] .upload-area:hover {
    border-color: #5cb8e6;
    box-shadow: 0 8px 25px rgba(92, 184, 230, 0.1);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area.dragover {
    border-color: #3399cc;
    background: var(--card-bg);
    transform: scale(1.01);
}

[data-theme="dark"] .upload-area.dragover {
    border-color: #5cb8e6;
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    color: #3399cc;
    margin-bottom: 20px;
}

[data-theme="dark"] .upload-icon {
    color: #5cb8e6;
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.upload-subtitle {
    color: var(--text-muted);
    margin: 0 0 20px;
    font-size: 1rem;
}

.upload-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--card-secondary);
    padding: 8px 16px;
    border-radius: 20px;
}

/* ============================================
   Editor Section - Multi-file
   ============================================ */
.editor-section {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Files Header */
.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--card-secondary);
    border-bottom: 1px solid var(--border-color);
}

.files-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.files-header-left svg {
    color: #3399cc;
}

[data-theme="dark"] .files-header-left svg {
    color: #5cb8e6;
}

.file-size-badge {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--card-tertiary);
    padding: 4px 10px;
    border-radius: 12px;
}

.btn-text {
    background: none;
    border: none;
    color: #3399cc;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

[data-theme="dark"] .btn-text {
    color: #5cb8e6;
}

.btn-text:hover {
    background: rgba(51, 153, 204, 0.1);
}

[data-theme="dark"] .btn-text:hover {
    background: rgba(92, 184, 230, 0.15);
}

/* ============================================
   File List Row - Thumbnails
   ============================================ */
.file-list-row {
    display: flex;
    gap: 12px;
    padding: 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.file-list-row::-webkit-scrollbar {
    height: 6px;
}

.file-list-row::-webkit-scrollbar-track {
    background: transparent;
}

.file-list-row::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* File Card */
.file-card {
    flex: 0 0 140px;
    background: var(--card-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    position: relative;
    transition: border-color 0.2s ease;
}

.file-card:hover {
    border-color: #3399cc;
}

[data-theme="dark"] .file-card:hover {
    border-color: #5cb8e6;
}

.file-card-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(230, 78, 78, 0.1);
    color: #e64e4e;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.file-card-remove:hover {
    background: #e64e4e;
    color: white;
}

.file-card-remove svg {
    width: 14px;
    height: 14px;
}

.file-thumb {
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    background: rgba(51, 153, 204, 0.08);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #3399cc;
}

[data-theme="dark"] .file-thumb {
    background: rgba(92, 184, 230, 0.12);
    color: #5cb8e6;
}

.file-thumb svg {
    width: 24px;
    height: 24px;
}

.file-thumb-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-thumb.has-image {
    background: none;
    overflow: hidden;
}

.file-thumb.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.file-card-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.file-card-size {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Add More Card */
.add-more-card {
    flex: 0 0 100px;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
    min-height: 120px;
}

.add-more-card:hover {
    border-color: #3399cc;
    color: #3399cc;
    background: rgba(51, 153, 204, 0.04);
}

[data-theme="dark"] .add-more-card:hover {
    border-color: #5cb8e6;
    color: #5cb8e6;
    background: rgba(92, 184, 230, 0.06);
}

.add-more-card svg {
    width: 24px;
    height: 24px;
}

.add-more-card span {
    font-size: 0.8rem;
    font-weight: 600;
}

/* ============================================
   Settings Panel
   ============================================ */
.settings-panel {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.panel-header {
    margin-bottom: 20px;
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.panel-header h3 svg {
    color: #3399cc;
}

[data-theme="dark"] .panel-header h3 svg {
    color: #5cb8e6;
}

.quality-section {
    margin-bottom: 20px;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.section-label svg {
    color: #3399cc;
}

[data-theme="dark"] .section-label svg {
    color: #5cb8e6;
}

.quality-slider-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-input {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #3399cc;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(51, 153, 204, 0.4);
    transition: transform 0.2s ease;
}

[data-theme="dark"] .slider-input::-webkit-slider-thumb {
    background: #5cb8e6;
    box-shadow: 0 2px 8px rgba(92, 184, 230, 0.4);
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #3399cc;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(51, 153, 204, 0.4);
}

[data-theme="dark"] .slider-input::-moz-range-thumb {
    background: #5cb8e6;
    box-shadow: 0 2px 8px rgba(92, 184, 230, 0.4);
}

.quality-value-display {
    min-width: 60px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #3399cc;
    background: rgba(51, 153, 204, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
}

[data-theme="dark"] .quality-value-display {
    color: #5cb8e6;
    background: rgba(92, 184, 230, 0.15);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 8px;
}

.quality-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.preset-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.preset-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: #3399cc;
    color: #3399cc;
}

[data-theme="dark"] .preset-btn:hover {
    border-color: #5cb8e6;
    color: #5cb8e6;
}

.preset-btn.active {
    background: #3399cc;
    border-color: #3399cc;
    color: white;
}

[data-theme="dark"] .preset-btn.active {
    background: #5cb8e6;
    border-color: #5cb8e6;
    color: #0f172a;
}

.quality-info {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: rgba(51, 153, 204, 0.08);
    border-radius: 10px;
    margin-top: 15px;
}

[data-theme="dark"] .quality-info {
    background: rgba(92, 184, 230, 0.12);
}

.quality-info .info-icon {
    color: #3399cc;
    flex-shrink: 0;
}

[data-theme="dark"] .quality-info .info-icon {
    color: #5cb8e6;
}

.quality-info .info-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.quality-info .info-text a {
    color: #3399cc;
    text-decoration: none;
}

[data-theme="dark"] .quality-info .info-text a {
    color: #5cb8e6;
}

.quality-info .info-text a:hover {
    text-decoration: underline;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--card-secondary);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: #3399cc;
    color: white;
    box-shadow: 0 4px 15px rgba(51, 153, 204, 0.3);
}

[data-theme="dark"] .btn-primary {
    background: #5cb8e6;
    color: #0f172a;
}

.btn-primary:hover {
    background: #2b82b0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 153, 204, 0.4);
}

[data-theme="dark"] .btn-primary:hover {
    background: #42a5d9;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--card-secondary);
    color: var(--text-primary);
}

.btn-success {
    background: #339966;
    color: white;
    box-shadow: 0 4px 15px rgba(51, 153, 102, 0.3);
}

[data-theme="dark"] .btn-success {
    background: #4ade80;
    color: #0f172a;
}

.btn-success:hover {
    background: #2d8659;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 153, 102, 0.4);
}

[data-theme="dark"] .btn-success:hover {
    background: #22c55e;
}

/* ============================================
   Results Section - Multi-file
   ============================================ */
.results-section {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 30px;
    text-align: center;
}

.results-header {
    margin-bottom: 25px;
}

.results-icon {
    width: 70px;
    height: 70px;
    background: #339966;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(51, 153, 102, 0.3);
}

[data-theme="dark"] .results-icon {
    background: #4ade80;
    color: #0f172a;
}

.results-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
}

.results-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0;
}

/* Results Grid - Thumbnail row */
.results-grid {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.result-card {
    flex: 0 0 160px;
    background: var(--card-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: border-color 0.2s ease;
}

.result-card:hover {
    border-color: #3399cc;
}

[data-theme="dark"] .result-card:hover {
    border-color: #5cb8e6;
}

.result-thumb {
    width: 100%;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    background:
        linear-gradient(45deg, var(--card-tertiary) 25%, transparent 25%),
        linear-gradient(-45deg, var(--card-tertiary) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--card-tertiary) 75%),
        linear-gradient(-45deg, transparent 75%, var(--card-tertiary) 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.result-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.result-sizes {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.result-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 14px;
    background: #339966;
    color: white;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

[data-theme="dark"] .result-download {
    background: #4ade80;
    color: #0f172a;
}

.result-download:hover {
    background: #2d8659;
}

[data-theme="dark"] .result-download:hover {
    background: #22c55e;
}

.result-download svg {
    width: 14px;
    height: 14px;
}

/* ZIP Download Bar */
.zip-download-bar {
    background: var(--card-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    gap: 15px;
}

.zip-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.zip-info svg {
    color: #3399cc;
    flex-shrink: 0;
}

[data-theme="dark"] .zip-info svg {
    color: #5cb8e6;
}

/* Results Actions */
.results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ============================================
   Error Message
   ============================================ */
.error-message {
    background: rgba(230, 78, 78, 0.08);
    color: #e64e4e;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px;
    font-weight: 500;
    line-height: 1.6;
}

[data-theme="dark"] .error-message {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
}

.error-message a {
    color: #3399cc;
    text-decoration: underline;
}

[data-theme="dark"] .error-message a {
    color: #5cb8e6;
}

/* ============================================
   Related Tools
   ============================================ */
.related-tools {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.related-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.related-label svg {
    color: #3399cc;
}

[data-theme="dark"] .related-label svg {
    color: #5cb8e6;
}

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

.related-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--card-secondary);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.related-link:hover {
    background: rgba(51, 153, 204, 0.12);
    color: #3399cc;
}

[data-theme="dark"] .related-link:hover {
    background: rgba(92, 184, 230, 0.15);
    color: #5cb8e6;
}

.related-link svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Info Sections
   ============================================ */
.info-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.info-card {
    padding: 25px 30px;
}

.info-card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px;
}

.info-card h2 svg {
    color: #3399cc;
}

[data-theme="dark"] .info-card h2 svg {
    color: #5cb8e6;
}

/* Steps List */
.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step;
}

.steps-list li {
    position: relative;
    padding-left: 50px;
    margin-bottom: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
    counter-increment: step;
}

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: #3399cc;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

[data-theme="dark"] .steps-list li::before {
    background: #5cb8e6;
    color: #0f172a;
}

.steps-list li:last-child {
    margin-bottom: 0;
}

.steps-list a,
.info-card a {
    color: #3399cc;
    text-decoration: none;
}

[data-theme="dark"] .steps-list a,
[data-theme="dark"] .info-card a {
    color: #5cb8e6;
}

.steps-list a:hover,
.info-card a:hover {
    text-decoration: underline;
}

/* Tip Note */
.tip-note {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: rgba(51, 153, 204, 0.08);
    border-radius: 10px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    align-items: flex-start;
}

[data-theme="dark"] .tip-note {
    background: rgba(92, 184, 230, 0.12);
}

.tip-note svg {
    color: #3399cc;
    flex-shrink: 0;
    margin-top: 2px;
}

[data-theme="dark"] .tip-note svg {
    color: #5cb8e6;
}

.tip-note a {
    color: #3399cc;
    text-decoration: none;
}

[data-theme="dark"] .tip-note a {
    color: #5cb8e6;
}

.tip-note a:hover {
    text-decoration: underline;
}

/* Use Cases */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.use-case {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: var(--card-secondary);
    border-radius: 10px;
}

.use-case-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(51, 153, 204, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3399cc;
}

[data-theme="dark"] .use-case-icon {
    background: rgba(92, 184, 230, 0.15);
    color: #5cb8e6;
}

.use-case-content h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.use-case-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Format Explanations */
.format-explanations {
    display: grid;
    gap: 15px;
}

.format-explain {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--card-secondary);
    border-radius: 10px;
}

.format-tag {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    height: fit-content;
    color: white;
}

.format-tag.jxl { background: #3399cc; }
.format-tag.jpg { background: #e64e4e; }

[data-theme="dark"] .format-tag.jxl { background: #5cb8e6; color: #0f172a; }
[data-theme="dark"] .format-tag.jpg { background: #f87171; color: #0f172a; }

.format-explain p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

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

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--card-secondary);
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: var(--card-tertiary);
}

.faq-question svg {
    color: #3399cc;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

[data-theme="dark"] .faq-question svg {
    color: #5cb8e6;
}

.faq-item.open .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 15px 20px 20px;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
    border-top: 1px solid var(--border-color);
}

.faq-answer a {
    color: #3399cc;
    text-decoration: none;
}

[data-theme="dark"] .faq-answer a {
    color: #5cb8e6;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* ============================================
   Processing Overlay
   ============================================ */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.processing-content {
    background: var(--card-bg);
    padding: 40px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: #3399cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

[data-theme="dark"] .processing-spinner {
    border-top-color: #5cb8e6;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
}

.processing-subtitle {
    color: var(--text-muted);
    margin: 0 0 25px;
}

.progress-bar {
    height: 8px;
    background: var(--card-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #3399cc;
    border-radius: 4px;
    transition: width 0.3s ease;
}

[data-theme="dark"] .progress-fill {
    background: #5cb8e6;
}

.progress-text {
    font-weight: 600;
    color: #3399cc;
    margin: 0;
}

[data-theme="dark"] .progress-text {
    color: #5cb8e6;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .tool-container {
        padding: 15px 10px 30px;
    }

    .tool-title { font-size: 1.6rem; }
    .tool-description { font-size: 1rem; }
    .upload-area { padding: 35px 20px; }
    .upload-title { font-size: 1.2rem; }

    .files-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .file-list-row {
        padding: 15px;
        gap: 10px;
    }

    .file-card { flex: 0 0 120px; }
    .add-more-card { flex: 0 0 80px; }

    .action-bar { flex-direction: column; }
    .btn { width: 100%; }

    .results-grid { gap: 10px; }
    .result-card { flex: 0 0 140px; }

    .zip-download-bar {
        flex-direction: column;
        text-align: center;
    }

    .related-tools {
        flex-direction: column;
        align-items: flex-start;
    }

    .related-links { width: 100%; }
    .related-link {
        flex: 1;
        min-width: calc(50% - 5px);
        justify-content: center;
    }

    .info-card { padding: 20px; }
    .info-card h2 { font-size: 1.15rem; }
    .format-explain { flex-direction: column; gap: 10px; }
    .use-cases-grid { grid-template-columns: 1fr; }

    .results-actions { flex-direction: column; }
    .results-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
    .tool-title-row {
        flex-direction: column;
        gap: 10px;
    }

    .quality-presets { justify-content: center; }
    .preset-label { width: 100%; text-align: center; }
    .steps-list li { padding-left: 42px; }
    .steps-list li::before { width: 28px; height: 28px; font-size: 0.8rem; }
    .result-card { flex: 0 0 130px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

::selection {
    background: rgba(51, 153, 204, 0.2);
    color: var(--text-primary);
}

[data-theme="dark"] ::selection {
    background: rgba(92, 184, 230, 0.3);
}
