/* ===== tool-wrapper ===== */
.tool-wrapper {
    max-width: 860px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2d3748;
}


/* ===== Info Note ===== */
.info-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #ebf8ff;
    padding: 0.9rem 1.2rem;
    border-radius: 0.75rem;
    color: #2b6cb0;
    margin-bottom: 1.5rem;
}
.info-note i {
    font-size: 1.3rem;
    margin-top: 0.1rem;
}
.note-content strong {
    display: inline-block;
    margin-right: 0.3rem;
}

/* ===== Preview Box ===== */
.preview-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.preview-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.tracking-id {
    font-size: 0.75rem;
    background: #edf2f7;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    color: #4a5568;
}
.preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #edf2f7;
    padding: 1rem;
}
.preview-content canvas {
    max-width: 100%;
    max-height: 400px;
    border-radius: 0.4rem;
}

/* ===== Tool Settings ===== */
.tool-settings {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
}
.tool-settings h3 {
    margin-top: 0;
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.option-group {
    margin-bottom: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.option-group.full-width {
    flex-direction: column;
    align-items: stretch;
}
.option-group label {
    font-weight: 600;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.option-group select,
.option-group input[type="text"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid #cbd5e0;
    border-radius: 0.4rem;
    background: #fff;
    flex: 1;
    min-width: 120px;
}
.option-group small {
    color: #718096;
    font-size: 0.8rem;
    width: 100%;
    margin-top: 0.2rem;
}
.option-group .page-input.hidden {
    display: none;
}
.option-group .page-input {
    flex: 1;
    min-width: 120px;
}

/* Quality Slider */
#quality-range {
    width: 100%;
    margin: 0.4rem 0;
}
.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #4a5568;
}
.quality-hint {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 0.2rem;
}
.badge {
    background: #3182ce;
    color: #fff;
    padding: 0.1rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.8rem;
}

/* Preset Buttons */
.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.3rem;
}
.preset-btn {
    background: #edf2f7;
    border: 1px solid #e2e8f0;
    padding: 0.3rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
}
.preset-btn.active {
    background: #3182ce;
    color: #fff;
    border-color: #3182ce;
}
.preset-btn:hover {
    background: #e2e8f0;
}
.preset-btn.active:hover {
    background: #2b6cb0;
}

/* ===== Stats Summary ===== */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
    background: #f7fafc;
    border-radius: 0.75rem;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}
.stat-item {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #718096;
    letter-spacing: 0.03em;
}
.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

/* ===== Compression Stats (status) ===== */
.compression-stats {
    background: #f7fafc;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #4a5568;
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: flex-end;
    align-items: center;
}
.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-secondary {
    background: #edf2f7;
    color: #2d3748;
}
.btn-secondary:hover {
    background: #e2e8f0;
}
.btn-primary {
    background: #3182ce;
    color: #fff;
}
.btn-primary:hover {
    background: #2b6cb0;
}
.btn-success {
    background: #38a169;
    color: #fff;
}
.btn-success:hover {
    background: #2f855a;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Hidden ===== */
.hidden {
    display: none !important;
}

/* ===== Force show for settings when not hidden ===== */
.tool-settings:not(.hidden) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .option-group {
        flex-direction: column;
        align-items: stretch;
    }
    .option-group label {
        min-width: auto;
    }
    .stats-summary {
        grid-template-columns: 1fr 1fr;
    }
    .action-buttons {
        justify-content: center;
    }
}