/* ============================================
   JPG to JXL Converter Styles
   Theme: Teal (#14B8A6)
   ============================================ */

:root {
    --primary: #14B8A6;
    --primary-dark: #0D9488;
    --primary-light: #CCFBF1;
    --primary-glow: rgba(20, 184, 166, 0.15);
    
    --success: #10B981;
    --success-light: #D1FAE5;
    --error: #EF4444;
    --error-light: #FEE2E2;
    
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 30px var(--primary-glow);
}

* { box-sizing: border-box; }

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

/* Hero Section */
.tool-header {
    text-align: center;
    margin-bottom: 35px;
}

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

.tool-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.tool-icon-wrapper.jxl-theme {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

.tool-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.tool-description {
    font-size: 1.1rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Main Tool Area */
.tool-main {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 35px;
    margin-bottom: 40px;
}

/* Upload Section */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-xl);
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gray-50);
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.01);
    box-shadow: var(--shadow-glow);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon { color: var(--primary); margin-bottom: 8px; }
.upload-title { font-size: 1.4rem; font-weight: 600; color: var(--gray-800); margin: 0; }
.upload-subtitle { color: var(--gray-500); margin: 0; }

.file-types {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
}

.file-type-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-dark);
}

.file-type-badge.arrow { background: transparent; color: var(--gray-400); padding: 6px 4px; }
.file-type-badge.output { background: var(--success-light); color: var(--success); }
.upload-hint { font-size: 0.85rem; color: var(--gray-400); }

/* Options Section */
.options-section { animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-info-bar {
    display: flex;
    gap: 25px;
    padding: 15px 20px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    margin-bottom: 25px;
}

.file-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.file-info-item svg { color: var(--primary); }

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.options-card {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.option-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.option-header svg { color: var(--primary); }
.option-header h4 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--gray-800); }

.option-note {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 10px 0 0;
}

/* Quality Slider */
.quality-slider-container { padding: 0 5px; }

.quality-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--success), var(--primary), #F59E0B);
    outline: none;
    margin-bottom: 12px;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease;
}

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

.quality-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.quality-value { font-weight: 600; color: var(--primary); }

/* Effort Options (Radio) */
.effort-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover { background: var(--primary-light); }

.radio-option input[type="radio"] { display: none; }

.radio-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked + .radio-mark {
    border-color: var(--primary);
}

.radio-option input[type="radio"]:checked + .radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.radio-label { display: flex; flex-direction: column; }
.radio-label strong { font-size: 0.95rem; color: var(--gray-800); }
.radio-label small { font-size: 0.8rem; color: var(--gray-500); }

/* Action Bar */
.action-bar {
    display: flex;
    gap: 15px;
    justify-content: center;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Progress Container */
.progress-container { text-align: center; padding: 30px; }

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text { color: var(--gray-600); font-size: 0.95rem; }

/* Results */
.results-section, .error-section { animation: fadeIn 0.4s ease; }

.result-card {
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
}

.result-card.success { background: var(--success-light); }
.result-card.error { background: var(--error-light); }

.result-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.result-card.success .result-header svg { color: var(--success); }
.result-card.error .result-header svg { color: var(--error); }
.result-header h3 { margin: 0; font-size: 1.3rem; color: var(--gray-800); }

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat { text-align: center; }
.stat.highlight .stat-value { color: var(--primary); }
.stat-label { display: block; font-size: 0.8rem; color: var(--gray-500); margin-bottom: 4px; }
.stat-value { font-size: 1.1rem; font-weight: 600; color: var(--gray-800); }
.stat-value.savings { color: var(--success); }

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-message { color: var(--error); margin-bottom: 20px; }

/* Related Tools */
.related-tools {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.related-label { font-weight: 600; color: var(--gray-600); }

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

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

.related-link:hover { background: var(--primary-light); color: var(--primary-dark); }
.related-link svg { width: 16px; height: 16px; }

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

.info-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

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

.info-card h2 svg { color: var(--primary); }

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

.steps-list li {
    position: relative;
    padding-left: 50px;
    margin-bottom: 18px;
    line-height: 1.6;
    color: var(--gray-700);
}

.steps-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

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

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.feature-item:hover { background: white; box-shadow: var(--shadow-md); }

.feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.feature-icon.blue { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.feature-icon.green { background: linear-gradient(135deg, #10B981, #059669); }
.feature-icon.purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.feature-icon.orange { background: linear-gradient(135deg, #F97316, #EA580C); }

.feature-content h3 { margin: 0 0 5px; font-size: 1rem; color: var(--gray-800); }
.feature-content p { margin: 0; font-size: 0.9rem; color: var(--gray-600); line-height: 1.5; }

/* Quality Guide */
.quality-guide { display: flex; flex-direction: column; gap: 15px; }

.guide-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.guide-item.recommended {
    background: var(--primary-light);
    border: 2px solid var(--primary);
}

.guide-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.guide-badge.lossless { background: var(--success-light); color: var(--success); }
.guide-badge.balanced { background: var(--primary-light); color: var(--primary-dark); }
.guide-badge.smaller { background: #FEF3C7; color: #D97706; }

.guide-content strong { display: block; margin-bottom: 4px; color: var(--gray-800); }
.guide-content p { margin: 0; font-size: 0.9rem; color: var(--gray-600); line-height: 1.5; }

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

.faq-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.faq-question:hover { background: var(--gray-100); }
.faq-question svg { flex-shrink: 0; color: var(--gray-400); transition: transform 0.3s ease; }
.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: 300px; }

.faq-answer p {
    padding: 15px 20px;
    margin: 0;
    color: var(--gray-600);
    line-height: 1.6;
    background: white;
}

.faq-answer a { color: var(--primary); text-decoration: none; }
.faq-answer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    .tool-container { padding: 20px 15px 40px; }
    .tool-title { font-size: 1.8rem; }
    .tool-main { padding: 25px 20px; }
    .upload-area { padding: 35px 20px; }
    .file-info-bar { flex-direction: column; gap: 12px; }
    .options-grid { grid-template-columns: 1fr; }
    .action-bar { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
    .result-stats { gap: 20px; }
    .result-actions { flex-direction: column; }
    .features-grid { grid-template-columns: 1fr; }
    .related-tools { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .tool-title-row { flex-direction: column; gap: 10px; }
    .tool-icon-wrapper { width: 48px; height: 48px; }
    .file-types { flex-wrap: wrap; justify-content: center; }
    .guide-item { flex-direction: column; }
}

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