/* Base Resets & Variables */
:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #cbd5e1;
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --light-blue-bg: #eff6ff;
    --card-bg: #ffffff;
    --success-green: #10b981;
    --error-red: #ef4444;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.tool-header {
    text-align: center;
    margin-bottom: 32px;
}

.tool-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.tool-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Tool UI Screens */
.tool-ui {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    padding: 32px;
    margin-bottom: 48px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Upload Box */
.upload-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 20px;
    text-align: center;
    background-color: #fafbfc;
    transition: all 0.2s ease;
    cursor: pointer;
}

.upload-box:hover, .upload-box.drag-over {
    border-color: var(--primary-blue);
    background-color: var(--light-blue-bg);
}

.icon-circle {
    width: 64px;
    height: 64px;
    background-color: var(--light-blue-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.upload-box h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-box .subtext {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Buttons */
.cta-button {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.cta-button:hover {
    background-color: var(--primary-blue-hover);
}

.cta-button:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
}

.cta-button.success-action {
    background-color: var(--success-green);
}

.cta-button.success-action:hover {
    background-color: #059669;
}

.secondary-btn {
    background-color: white;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background-color: var(--light-blue-bg);
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.text-btn:hover {
    color: var(--text-primary);
}

/* Badges */
.badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.badge {
    background-color: #f1f5f9;
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

.privacy-note {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 16px;
}

/* Convert Screen */
.convert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.convert-header h2 {
    font-size: 1.25rem;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.file-row {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    background: white;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.file-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 16px;
}

.file-meta {
    font-size: 0.85rem;
    display: flex;
    gap: 8px;
}

.file-status {
    font-weight: 500;
}

.status-pending { color: var(--text-secondary); }
.status-converting { color: var(--primary-blue); }
.status-done { color: var(--success-green); }
.status-error { color: var(--error-red); }

.remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 12px;
    line-height: 1;
}

.remove-btn:hover {
    color: var(--error-red);
}

/* Progress Bar */
.progress-bar-container {
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-blue);
    width: 0%;
    transition: width 0.3s ease;
}

.file-actions {
    display: flex;
    justify-content: flex-end;
}

.download-single-btn {
    display: none;
    background-color: var(--light-blue-bg);
    color: var(--primary-blue);
    border: 1px solid #bfdbfe;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    align-items: center;
    gap: 6px;
}

.download-single-btn:hover {
    background-color: #dbeafe;
}

/* Advanced Options */
.advanced-options-wrapper {
    margin-bottom: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.toggle-btn:hover {
    color: var(--text-primary);
}

.toggle-btn .chevron {
    transition: transform 0.3s ease;
}

.toggle-btn.expanded .chevron {
    transform: rotate(180deg);
}

.advanced-panel {
    display: none;
    padding: 16px;
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    margin-top: 12px;
    border: 1px solid var(--border-color);
}

.advanced-panel.open {
    display: block;
}

.advanced-panel label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.advanced-panel select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    margin-bottom: 8px;
    background-color: white;
}

.quality-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Action Buttons Footer */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}



/* Responsive */
@media (max-width: 640px) {
    .tool-container {
        padding: 20px 16px;
    }

    .tool-ui, .seo-content {
        padding: 24px 16px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons button {
        width: 100%;
    }

    #reset-btn {
        padding: 12px;
    }
    
    .convert-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .advanced-panel select {
        max-width: 100%;
    }
}


/* =========================================================
   HEIC to JPG SEO Content + FAQ UI
   Lightweight | Mobile/iPad/Desktop Friendly
========================================================= */

.content-wrap {
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 20px;
}

/* SEO content section */
.seo-section {
    margin: 48px auto 44px;
}

/* Main white cards */
.seo-card {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    padding: 32px 36px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.seo-card-highlight {
    background: #f8fbff;
    border-color: #bfdbfe;
}

/* Headings */
.seo-card-title {
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    line-height: 1.28;
    font-weight: 800;
    color: #15375f;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #dbe3ef;
    letter-spacing: -0.02em;
}

.seo-card h3,
.seo-mini-card h3 {
    color: #15375f;
}

.seo-card p {
    font-size: 1.02rem;
    line-height: 1.78;
    color: #334155;
    margin: 0 0 14px;
}

.seo-card p:last-child {
    margin-bottom: 0;
}

.seo-card a,
.faq-a a {
    color: var(--primary-blue);
    font-weight: 650;
    text-underline-offset: 3px;
}

.seo-card a:hover,
.faq-a a:hover {
    color: var(--primary-blue-hover);
}

/* Mini cards grid */
.seo-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.seo-mini-card {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 18px;
}

.seo-mini-card h3 {
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 800;
    margin: 0 0 8px;
}

.seo-mini-card p {
    font-size: 0.96rem;
    line-height: 1.68;
    color: #475569;
    margin: 0;
}

/* Benefit checklist */
.seo-check-list {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: grid;
    gap: 10px;
}

.seo-check-list li {
    position: relative;
    background: #f3f7ff;
    border: 1px solid #d6e4ff;
    border-radius: 12px;
    padding: 12px 14px 12px 42px;
    color: #334155;
    font-size: 1rem;
    line-height: 1.55;
}

.seo-check-list li::before {
    content: "✓";
    position: absolute;
    left: 16px;
    top: 12px;
    color: var(--primary-blue);
    font-weight: 800;
}

.seo-check-list strong {
    color: #15375f;
}

/* FAQ section */
.faq-wrap {
    max-width: 1060px;
    margin: 0 auto 56px;
    padding: 0 20px;
}

.faq-section {
    margin-top: 20px;
}

.section-title {
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.28;
    font-weight: 800;
    color: #15375f;
    text-align: center;
    margin: 0 0 26px;
}

/* FAQ cards */
.faq-item {
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    margin-bottom: 14px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.035);
    overflow: hidden;
    padding: 0;
}

.faq-q {
    width: 100%;
    border: 0;
    background: #ffffff;
    color: #0f2746;
    padding: 20px 22px;
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.faq-q:hover {
    background: #f8fbff;
}

.faq-icon {
    color: var(--primary-blue);
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 700;
    flex: 0 0 auto;
}

.faq-a {
    display: none;
    padding: 0 22px 20px;
    color: #334155;
    font-size: 0.98rem;
    line-height: 1.72;
}

.faq-item.active .faq-a {
    display: block;
}



/* Tablet */
@media (max-width: 900px) {
    .content-wrap,
    .faq-wrap {
        padding: 0 18px;
    }

    .seo-card {
        padding: 28px;
    }

    .seo-mini-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .content-wrap,
    .faq-wrap {
        padding: 0 14px;
    }

    .seo-section {
        margin: 34px auto;
    }

    .seo-card {
        padding: 22px 18px;
        border-radius: 14px;
        margin-bottom: 18px;
    }

    .seo-card-title {
        font-size: 1.42rem;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .seo-card p {
        font-size: 0.98rem;
        line-height: 1.72;
    }

    .seo-mini-grid {
        gap: 12px;
    }

    .seo-mini-card {
        padding: 16px;
    }

    .section-title {
        text-align: left;
        font-size: 1.42rem;
    }

    .faq-q {
        padding: 18px 16px;
        font-size: 0.98rem;
    }

    .faq-a {
        padding: 0 16px 18px;
        font-size: 0.96rem;
    }
}
