/**
 * King Addons - Image Optimizer Styles
 * Premium Apple-inspired design with dark/light theme support.
 *
 * @package King_Addons
 */

/* ===== IMAGE OPTIMIZER SPECIFIC STYLES ===== */

/* Wrapper override */
.ka-img-opt-wrap {
    max-width: 1200px;
}

/* ===== NAVIGATION TABS ===== */
.ka-img-opt-tabs {
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 6px;
    border-radius: 980px;
    width: fit-content;
    margin: 0 auto 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.ka-img-opt-tab {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 500;
    color: #86868b;
    background: transparent;
    border: none;
    border-radius: 980px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ka-img-opt-tab:hover {
    color: #1d1d1f;
}

.ka-img-opt-tab.active {
    background: #fff;
    color: #1d1d1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ka-img-opt-tab-content .ka-row-label {
	width: 250px;
}

/* ===== STATISTICS CARDS ===== */
.ka-img-opt-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.ka-img-opt-stat-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.ka-img-opt-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}

.ka-img-opt-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ka-img-opt-stat-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #fff;
}

.ka-img-opt-stat-icon.purple {
    background: linear-gradient(135deg, #5e5ce6 0%, #bf5af2 100%);
}

.ka-img-opt-stat-icon.green {
    background: linear-gradient(135deg, #30d158 0%, #34c759 100%);
}

.ka-img-opt-stat-icon.orange {
    background: linear-gradient(135deg, #ff9f0a 0%, #ff9500 100%);
}

.ka-img-opt-stat-icon.blue {
    background: linear-gradient(135deg, #0a84ff 0%, #007aff 100%);
}

.ka-img-opt-stat-icon.red {
    background: linear-gradient(135deg, #ff453a 0%, #ff3b30 100%);
}

.ka-img-opt-stat-icon.grey {
    background: #8e8e93;
}

.ka-img-opt-stat-content {
    display: flex;
    flex-direction: column;
}

.ka-img-opt-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.2;
}

.ka-img-opt-stat-label {
    font-size: 14px;
    color: #86868b;
    margin-top: 2px;
}

/* ===== TAB CONTENT ===== */
.ka-img-opt-tab-content {
    display: none;
}

.ka-img-opt-tab-content.active {
    display: block;
}

/* ===== RESUME BANNER ===== */
.ka-img-opt-resume-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1d1d1f;
    border-radius: 16px;
    padding: 24px 70px 24px 28px;
    margin-bottom: 28px;
    color: #fff;
}

.ka-img-opt-resume-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.15s ease;
}

.ka-img-opt-resume-close .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ka-img-opt-resume-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
}

.ka-img-opt-resume-body {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ka-img-opt-resume-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #5e5ce6 0%, #bf5af2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ka-img-opt-resume-icon .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: #fff;
}

.ka-img-opt-resume-content h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.ka-img-opt-resume-content p {
    margin: 0 0 2px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.ka-img-opt-resume-progress {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
}

.ka-img-opt-resume-actions {
    display: flex;
    gap: 8px;
}

.ka-img-opt-resume-actions .ka-btn {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    color: #1d1d1f;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ka-img-opt-resume-actions .ka-btn:hover {
    background: #f5f5f7;
    color: #1d1d1f;
}

.ka-img-opt-resume-actions .ka-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.ka-img-opt-resume-actions .ka-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.ka-img-opt-resume-actions .ka-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.28);
}

.ka-img-opt-stat-card.large-card {
    grid-column: span 2;
}

/* ===== OPTION GROUPS ===== */
.ka-img-opt-option-group {
    margin-bottom: 32px;
}

.ka-img-opt-option-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
}

/* ===== QUALITY PRESETS ===== */
.ka-img-opt-quality-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.ka-img-opt-preset-btn {
    padding: 8px 16px;
    background: #f5f5f7;
    border: 2px solid transparent;
    border-radius: 980px;
    font-size: 13px;
    font-weight: 500;
    color: #86868b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ka-img-opt-preset-btn:hover {
    background: #ebebed;
    color: #1d1d1f;
}

.ka-img-opt-preset-btn.active {
    background: #1d1d1f;
    color: #fff;
}

/* ===== SLIDER ===== */
.ka-img-opt-slider-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 400px;

    /* Used to paint the slider fill via CSS vars (set by JS). */
    --ka-slider-pct: 0%;
    --ka-slider-fill-color: #5e5ce6;
    --ka-slider-track-color: #e5e5e7;
}

.ka-img-opt-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: linear-gradient(
        to right,
        var(--ka-slider-fill-color) 0%,
        var(--ka-slider-fill-color) var(--ka-slider-pct),
        var(--ka-slider-track-color) var(--ka-slider-pct),
        var(--ka-slider-track-color) 100%
    );
    border-radius: 3px;
    outline: none;
}

/* Firefox */
.ka-img-opt-slider::-moz-range-track {
    height: 6px;
    background: var(--ka-slider-track-color);
    border-radius: 3px;
}

.ka-img-opt-slider::-moz-range-progress {
    height: 6px;
    background: var(--ka-slider-fill-color);
    border-radius: 3px;
}

.ka-img-opt-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #5e5ce6 0%, #bf5af2 100%);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(94, 92, 230, 0.4);
    transition: transform 0.2s ease;
}

.ka-img-opt-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #5e5ce6 0%, #bf5af2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(94, 92, 230, 0.4);
    transition: transform 0.2s ease;
}

.ka-img-opt-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.ka-img-opt-slider-wrap output {
    min-width: 50px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--ka-slider-fill-color, #5e5ce6);
}

/* ===== ADVANCED SETTINGS ===== */
.ka-img-opt-advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f5f5f7;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #86868b;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.ka-img-opt-advanced-toggle:hover {
    background: #ebebed;
    color: #1d1d1f;
}

.ka-img-opt-advanced-toggle .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ka-img-opt-advanced-content {
    padding: 24px;
    background: #f5f5f7;
    border-radius: 16px;
    margin-bottom: 24px;
}

.ka-img-opt-resize-options {
    margin-top: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
}

.ka-img-opt-resize-options input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid #e5e5e7;
    border-radius: 6px;
    margin: 0 8px;
}

/* ===== ACTIONS ===== */
.ka-img-opt-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ka-btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.ka-btn-lg .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ===== PROGRESS SECTION ===== */
.ka-img-opt-progress-bar {
    height: 8px;
    background: #e5e5e7;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.ka-img-opt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5e5ce6 0%, #bf5af2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.ka-img-opt-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #86868b;
    margin-bottom: 24px;
}

/* Optimization Progress title icon states */
.ka-img-opt-progress .ka-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ka-img-opt-title-spinner.spinner {
    float: none;
    margin: 0;
}

/* Force CSS spinner (no GIF) for the progress title */
#ka-opt-progress-spinner.spinner {
    width: 18px;
    height: 18px;
    background: none !important;
    border: 2px solid rgba(134, 134, 139, 0.35);
    border-top-color: #5e5ce6;
    border-radius: 50%;
    box-sizing: border-box;
    opacity: 0;
}

#ka-opt-progress-spinner.spinner.is-active {
    opacity: 1;
    animation: kaSpin 0.8s linear infinite;
}

#ka-opt-progress-spinner.spinner.is-active.is-paused {
    animation-play-state: paused;
}

@keyframes kaSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* CSS spinner for buttons (restore, sync, etc.) */
.ka-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: kaSpin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.ka-img-opt-title-check,
.ka-img-opt-results .ka-card-header .dashicons-yes-alt {
    color: #34c759;
}

.ka-pro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    padding: 0 8px;
    margin-left: 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #5e5ce6 0%, #bf5af2 100%);
    line-height: 1;
}

.ka-row.ka-pro-locked .ka-toggle {
    cursor: not-allowed;
    opacity: 0.75;
}

.ka-row.ka-pro-locked input[disabled] + .ka-toggle-slider {
    filter: grayscale(0.2);
}

.ka-img-opt-quota {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ka-img-opt-quota-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.ka-img-opt-quota-title {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}

.ka-img-opt-quota-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 5px;
}

body:not(.ka-v3-dark) .ka-img-opt-quota {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body:not(.ka-v3-dark) .ka-img-opt-quota-title {
    color: rgba(0, 0, 0, 0.85);
}

body:not(.ka-v3-dark) .ka-img-opt-quota-sub {
    color: rgba(0, 0, 0, 0.65);
}

/* PRO / Free limits modal */
.ka-img-opt-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.ka-img-opt-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
}

.ka-img-opt-modal__dialog {
    position: relative;
    width: min(560px, calc(100% - 32px));
    margin: 8vh auto 0;
    border-radius: 16px;
    background: #1d1d1f;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    padding: 18px;
}

.ka-img-opt-modal__head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ka-img-opt-modal__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5e5ce6 0%, #bf5af2 100%);
    color: #fff;
}

.ka-img-opt-modal__title {
    font-size: 18px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
}

.ka-img-opt-modal__sub {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
}

.ka-img-opt-modal__body {
    margin-top: 14px;
}

.ka-img-opt-modal__quota {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ka-img-opt-modal__quota-k {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}

.ka-img-opt-modal__quota-v {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}

.ka-img-opt-modal__list {
    margin: 12px 0 0;
    padding-left: 18px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.ka-img-opt-modal__actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

body:not(.ka-v3-dark) .ka-img-opt-modal__dialog {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.20);
}

body:not(.ka-v3-dark) .ka-img-opt-modal__title {
    color: rgba(0, 0, 0, 0.9);
}

body:not(.ka-v3-dark) .ka-img-opt-modal__sub,
body:not(.ka-v3-dark) .ka-img-opt-modal__list,
body:not(.ka-v3-dark) .ka-img-opt-modal__quota-k {
    color: rgba(0, 0, 0, 0.65);
}

body:not(.ka-v3-dark) .ka-img-opt-modal__quota {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body:not(.ka-v3-dark) .ka-img-opt-modal__quota-v {
    color: rgba(0, 0, 0, 0.85);
}

#progress-percent {
    font-weight: 600;
    color: #5e5ce6;
}

.ka-img-opt-current-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f5f5f7;
    border-radius: 12px;
    margin-bottom: 24px;
}

.ka-img-opt-current-file .dashicons {
    color: #5e5ce6;
}

#current-filename {
    font-size: 14px;
    color: #1d1d1f;
}

/* ===== LIVE STATS ===== */
.ka-img-opt-live-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* ===== LIVE LIST (Bulk Progress) ===== */
.ka-img-opt-live-list-card {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e5e7;
}

.ka-img-opt-live-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ka-img-opt-live-tabs {
    display: inline-flex;
    gap: 8px;
    background: #f5f5f7;
    border: 1px solid #e5e5e7;
    border-radius: 999px;
    padding: 4px;
}

.ka-img-opt-live-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #1d1d1f;
    font-weight: 600;
    cursor: pointer;
}

.ka-img-opt-live-tab.active {
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.ka-img-opt-live-tab-count {
    min-width: 26px;
    height: 22px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(94, 92, 230, 0.12);
    color: #5e5ce6;
    font-size: 12px;
    font-weight: 700;
}

.ka-img-opt-live-filters {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ka-img-opt-live-filter {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #e5e5e7;
    background: #ffffff;
    color: #86868b;
    font-weight: 600;
    cursor: pointer;
}

.ka-img-opt-live-filter.active {
    background: #1d1d1f;
    border-color: #1d1d1f;
    color: #ffffff;
}

.ka-img-opt-live-list {
    max-height: 320px;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid #e5e5e7;
    background: #ffffff;
}

.ka-img-opt-live-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f2;
}

.ka-img-opt-live-item:last-child {
    border-bottom: 0;
}

.ka-img-opt-live-thumb {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f5f5f7;
    border: 1px solid #e5e5e7;
    overflow: hidden;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ka-img-opt-live-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ka-img-opt-live-meta {
    min-width: 0;
    flex: 1;
}

.ka-img-opt-live-title {
    font-weight: 700;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ka-img-opt-live-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #86868b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ka-img-opt-live-metrics {
    font-size: 12px;
    color: #6e6e73;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(94, 92, 230, 0.08);
    border: 1px solid rgba(94, 92, 230, 0.16);
}

.ka-img-opt-live-arrow,
.ka-img-opt-live-dot {
    color: #86868b;
}

.ka-img-opt-live-size-old {
    color: #6e6e73;
}

.ka-img-opt-live-size-new {
    color: #1f8a3b;
    font-weight: 700;
}

.ka-img-opt-live-pct {
    font-weight: 700;
    color: #5e5ce6;
}

.ka-img-opt-live-title-link {
    color: inherit;
    text-decoration: none;
}

.ka-img-opt-live-title-link:hover {
    text-decoration: underline;
}

.ka-img-opt-live-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.ka-img-opt-pill {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.ka-img-opt-pill.success {
    background: rgba(52, 199, 89, 0.12);
    border-color: rgba(52, 199, 89, 0.22);
    color: #1f8a3b;
}

.ka-img-opt-pill.skipped {
    background: rgba(142, 142, 147, 0.12);
    border-color: rgba(142, 142, 147, 0.25);
    color: #6e6e73;
}

.ka-img-opt-pill.error {
    background: rgba(255, 59, 48, 0.12);
    border-color: rgba(255, 59, 48, 0.22);
    color: #c62828;
}

.ka-img-opt-pill.current {
    background: rgba(10, 132, 255, 0.12);
    border-color: rgba(10, 132, 255, 0.22);
    color: #0a84ff;
}

.ka-img-opt-pill.pending {
    background: rgba(94, 92, 230, 0.10);
    border-color: rgba(94, 92, 230, 0.18);
    color: #5e5ce6;
}

.ka-img-opt-live-saved {
    font-size: 12px;
    font-weight: 700;
    color: #5e5ce6;
}

.ka-img-opt-live-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.ka-img-opt-live-page {
    color: #86868b;
    font-weight: 600;
}

.ka-img-opt-live-stat {
    text-align: center;
    padding: 16px;
    background: #f5f5f7;
    border-radius: 12px;
}

.ka-img-opt-live-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
}

.ka-img-opt-live-stat-label {
    display: block;
    font-size: 12px;
    color: #86868b;
    margin-top: 4px;
}

/* ===== CONTROLS ===== */
.ka-img-opt-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

/* ===== RESULTS ===== */
.ka-img-opt-results-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.ka-img-opt-result-item {
    text-align: center;
    padding: 32px;
    background: #f5f5f7;
    border-radius: 20px;
}

.ka-img-opt-result-icon {
    display: inline-block;
    width: 44px;
    height: 44px;
    font-size: 44px;
    line-height: 44px;
    margin-bottom: 12px;
    color: #86868b;
}

.ka-img-opt-result-item.success .ka-img-opt-result-icon {
    color: #34c759;
}

.ka-img-opt-result-item.saved .ka-img-opt-result-icon {
    color: #5e5ce6;
}

.ka-img-opt-result-item.percent .ka-img-opt-result-icon {
    color: #ff9500;
}

.ka-img-opt-result-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.ka-img-opt-result-label {
    font-size: 14px;
    color: #86868b;
}

.ka-img-opt-result-item.success .ka-img-opt-result-value {
    color: #34c759;
}

.ka-img-opt-result-item.saved .ka-img-opt-result-value {
    color: #5e5ce6;
}

.ka-img-opt-result-item.percent .ka-img-opt-result-value {
    color: #ff9500;
}

/* ===== FORMAT BREAKDOWN ===== */
.ka-img-opt-format-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ka-img-opt-format-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ka-img-opt-format-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.ka-img-opt-format-name {
    font-weight: 600;
    color: #1d1d1f;
}

.ka-img-opt-format-count {
    color: #86868b;
}

.ka-img-opt-format-bar {
    height: 8px;
    background: #e5e5e7;
    border-radius: 4px;
    overflow: hidden;
}

.ka-img-opt-format-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #5e5ce6 0%, #bf5af2 100%);
    border-radius: 4px;
}

/* ===== RESTORE SECTION ===== */
.ka-img-opt-restore-section {
    padding: 24px;
    background: #f5f5f7;
    border-radius: 16px;
    margin-bottom: 20px;
}

.ka-img-opt-restore-section:last-child {
    margin-bottom: 0;
}

.ka-img-opt-restore-section h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.ka-img-opt-restore-section p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #86868b;
}

.ka-btn.danger {
    color: #ff3b30;
    border-color: #ff3b30;
}

.ka-btn.danger:hover {
    background: rgba(255, 59, 48, 0.1);
}

/* ===== DARK MODE ===== */
body.ka-v3-dark .ka-img-opt-tabs {
    background: rgba(44, 44, 46, 0.72);
    border-color: rgba(255, 255, 255, 0.08);
}

body.ka-v3-dark .ka-img-opt-tab {
    color: #98989d;
}

body.ka-v3-dark .ka-img-opt-tab:hover {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-tab.active {
    background: #3a3a3c;
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-stat-card {
    background: #1c1c1e;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

body.ka-v3-dark .ka-img-opt-stat-value {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-option-label {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-preset-btn {
    background: #2c2c2e;
}

body.ka-v3-dark .ka-img-opt-preset-btn:hover {
    background: #3a3a3c;
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-preset-btn.active {
    background: #f5f5f7;
    color: #1d1d1f;
}

body.ka-v3-dark .ka-img-opt-slider-wrap {
    --ka-slider-track-color: #3a3a3c;
}

body.ka-v3-dark .ka-img-opt-advanced-toggle {
    background: #2c2c2e;
    color: #98989d;
}

body.ka-v3-dark .ka-img-opt-advanced-toggle:hover {
    background: #3a3a3c;
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-advanced-content {
    background: #1c1c1e;
}

body.ka-v3-dark .ka-img-opt-resize-options {
    background: #2c2c2e;
}

body.ka-v3-dark .ka-img-opt-resize-options input {
    background: #1c1c1e;
    border-color: #3a3a3c;
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-progress-bar,
body.ka-v3-dark .ka-img-opt-format-bar {
    background: #3a3a3c;
}

body.ka-v3-dark .ka-img-opt-current-file {
    background: #2c2c2e;
}

body.ka-v3-dark #current-filename {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-live-stat {
    background: #2c2c2e;
}

body.ka-v3-dark .ka-img-opt-live-list-card {
    background: #1c1c1e;
    border-color: #3a3a3c;
}

body.ka-v3-dark .ka-img-opt-live-tabs {
    background: #2c2c2e;
    border-color: #3a3a3c;
}

body.ka-v3-dark .ka-img-opt-live-tab {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-live-tab.active {
    background: #1c1c1e;
}

body.ka-v3-dark .ka-img-opt-live-filter {
    background: #1c1c1e;
    border-color: #3a3a3c;
    color: #98989d;
}

body.ka-v3-dark .ka-img-opt-live-filter.active {
    background: #f5f5f7;
    border-color: #f5f5f7;
    color: #1d1d1f;
}

body.ka-v3-dark .ka-img-opt-live-list {
    background: #1c1c1e;
    border-color: #3a3a3c;
}

body.ka-v3-dark .ka-img-opt-live-item {
    border-bottom-color: #2c2c2e;
}

body.ka-v3-dark .ka-img-opt-live-thumb {
    background: #2c2c2e;
    border-color: #3a3a3c;
}

body.ka-v3-dark .ka-img-opt-live-title {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-live-metrics {
    color: #98989d;
    background: rgba(94, 92, 230, 0.16);
    border-color: rgba(94, 92, 230, 0.28);
}

body.ka-v3-dark .ka-img-opt-live-size-old {
    color: #98989d;
}

body.ka-v3-dark .ka-img-opt-live-size-new {
    color: #34c759;
}

body.ka-v3-dark .ka-img-opt-live-stat-value,
body.ka-v3-dark .ka-img-opt-result-value {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-result-item {
    background: #2c2c2e;
}

body.ka-v3-dark .ka-img-opt-restore-section {
    background: #1c1c1e;
}

body.ka-v3-dark .ka-img-opt-restore-section h3 {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-format-name {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-img-opt-actions {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .ka-img-opt-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .ka-img-opt-live-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .ka-img-opt-results-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ka-img-opt-stats {
        grid-template-columns: 1fr;
    }

    .ka-img-opt-results-summary {
        grid-template-columns: 1fr;
    }

    .ka-img-opt-resume-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .ka-img-opt-resume-body {
        flex-direction: column;
    }
}
