/* ========================================
   IMAGE CONVERTER — STYLES
   Extends app.css variables
   ======================================== */

.ic-page {
    min-height: 100vh;
    padding: 100px 0 80px;
}

/* ---- Header ---- */
.ic-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
    padding-top: 20px;
}

.ic-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0;
    color: var(--text-primary);
}

.ic-title-accent { color: var(--accent); }

.ic-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 8px;
    line-height: 1.6;
}

.ic-free-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(163,230,53,0.1);
    border: 1px solid rgba(163,230,53,0.25);
    border-radius: 99px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ic-stats-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
    flex-wrap: wrap;
}

.ic-stats-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 2s infinite;
    flex-shrink: 0;
}

.ic-stats-div { opacity: 0.3; }

/* ---- Operation Tabs ---- */
.ic-ops-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ic-op-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    color: var(--text-muted);
    font-size: 13px;
}

.ic-op-btn i { font-size: 14px; }

.ic-op-btn:hover {
    border-color: var(--border-accent);
    color: var(--accent);
}

.ic-op-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.ic-op-name { font-weight: 700; }
.ic-op-hint {
    font-size: 10px;
    color: var(--text-muted);
}
.ic-op-btn.active .ic-op-hint { color: rgba(163,230,53,0.6); }

/* ---- Main Grid ---- */
.ic-main-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 960px) {
    .ic-main-grid { grid-template-columns: 1fr; }
}

/* ---- Glass Card ---- */
.ic-glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.ic-card-glow {
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(163,230,53,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ic-section-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.ic-section-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* ---- Steps ---- */
.ic-step { margin-bottom: 24px; }
.ic-step:last-child { margin-bottom: 0; }
.ic-hidden { display: none !important; }

.ic-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 12px;
}

/* ---- Drop Zone ---- */
.ic-drop-zone {
    position: relative;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.02);
    transition: border-color 0.25s, background 0.25s;
    cursor: pointer;
    overflow: hidden;
}

.ic-drop-zone:hover,
.ic-drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.ic-file-input {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.ic-drop-inner {
    padding: 28px 20px;
    text-align: center;
    pointer-events: none;
}

.ic-drop-icon {
    font-size: 1.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    transition: color 0.25s;
}

.ic-drop-zone:hover .ic-drop-icon,
.ic-drop-zone.drag-over .ic-drop-icon { color: var(--accent); }

.ic-drop-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.ic-drop-hint { font-size: 11px; color: var(--text-muted); }

/* ---- File List ---- */
.ic-file-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 180px;
    overflow-y: auto;
}

.ic-file-list::-webkit-scrollbar { width: 4px; }
.ic-file-list::-webkit-scrollbar-thumb { background: #1e3a3a; border-radius: 99px; }

.ic-file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
}

.ic-file-row:hover { border-color: var(--border-accent); }

.ic-file-thumb {
    width: 32px; height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}

.ic-file-info { flex: 1; min-width: 0; }

.ic-file-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ic-file-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

.ic-file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 10px;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.ic-file-remove:hover {
    color: #f87171;
    background: rgba(248,113,113,0.1);
}

/* ---- Format Grid ---- */
.ic-format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.ic-fmt-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.22s;
    color: var(--text-muted);
}

.ic-fmt-btn:hover {
    border-color: var(--border-accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.ic-fmt-btn.active {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

.ic-fmt-ext {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
    font-family: 'Space Grotesk', monospace;
}

.ic-fmt-desc { font-size: 10px; font-weight: 500; }

/* ---- Quality Slider ---- */
.ic-quality-wrap {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.ic-quality-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ic-quality-val {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
}

.ic-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    outline: none;
    cursor: pointer;
}

.ic-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(163,230,53,0.15);
    transition: box-shadow 0.2s;
}

.ic-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 6px rgba(163,230,53,0.25);
}

.ic-quality-hints {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 10px;
    color: var(--text-muted);
}

/* ---- Target Grid (Compress) ---- */
.ic-target-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.ic-target-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.22s;
    color: var(--text-muted);
}

.ic-target-btn:hover {
    border-color: var(--border-accent);
    color: var(--accent);
}

.ic-target-btn.active {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

.ic-target-pct {
    font-size: 14px;
    font-weight: 800;
    font-family: 'Space Grotesk', monospace;
}

.ic-target-desc { font-size: 10px; font-weight: 500; }

/* ---- Resize Inputs ---- */
.ic-resize-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.ic-resize-field {
    display: flex;
    align-items: center;
    flex: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.25s;
}

.ic-resize-field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(163,230,53,0.08);
}

.ic-resize-prefix {
    padding: 0 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(163,230,53,0.05);
    border-right: 1px solid var(--border);
    height: 100%;
    display: flex;
    align-items: center;
}

.ic-resize-suffix {
    padding: 0 10px;
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    border-left: 1px solid var(--border);
    height: 100%;
    display: flex;
    align-items: center;
}

.ic-resize-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 10px;
    width: 0;
    min-width: 0;
}

.ic-lock-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.22s;
    flex-shrink: 0;
}

.ic-lock-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Presets ---- */
.ic-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ic-preset {
    padding: 5px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.ic-preset:hover {
    border-color: var(--border-accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ---- Process Btn ---- */
.ic-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: var(--primary-bg);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--ease-bounce);
}

.ic-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.ic-btn-primary:active { transform: scale(0.97); }
.ic-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---- Right Panel ---- */
.ic-panel-right { position: sticky; top: 100px; }

.ic-preview-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.ic-preview-wrap::before {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(163,230,53,0.04) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ---- Empty State ---- */
.ic-state-empty { text-align: center; width: 100%; }

.ic-empty-icon {
    font-size: 3rem;
    color: rgba(255,255,255,0.05);
    margin-bottom: 16px;
}

.ic-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.ic-empty-sub {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 280px;
    margin: 0 auto 20px;
}

.ic-badge-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ic-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Preview State ---- */
.ic-state-preview { width: 100%; }

.ic-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ic-preview-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
}

.ic-preview-count {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 3px 10px;
}

.ic-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
}

.ic-preview-grid::-webkit-scrollbar { width: 4px; }
.ic-preview-grid::-webkit-scrollbar-thumb { background: #1e3a3a; border-radius: 99px; }

.ic-prev-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    aspect-ratio: 1;
}

.ic-prev-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ic-prev-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 16px 6px 6px;
    font-size: 9px;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

/* ---- Processing ---- */
.ic-state-processing { text-align: center; width: 100%; }

.ic-spinner-ring {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
}

.ic-spinner-ring::before {
    content: '';
    position: absolute; inset: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    animation: ic-spin 0.9s linear infinite;
}

.ic-spinner-inner {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 1.2s infinite;
}

.ic-proc-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.ic-proc-sub { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

.ic-progress-bar-wrap {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 99px;
    overflow: hidden;
    max-width: 260px;
    margin: 0 auto;
}

.ic-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.3s ease;
}

/* ---- Result ---- */
.ic-state-result { text-align: center; width: 100%; }

.ic-result-checkmark {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(163,230,53,0.1);
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--accent);
    margin: 0 auto 16px;
    animation: ic-pop 0.5s var(--ease-bounce);
}

.ic-result-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.ic-result-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.ic-result-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ic-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

.ic-result-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    max-width: 280px;
    margin: 0 auto;
}

.ic-btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: var(--primary-bg);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s var(--ease-bounce);
    width: 100%;
}

.ic-btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.ic-btn-download-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--accent);
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--border-accent);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    width: 100%;
}

.ic-btn-download-outline:hover {
    background: var(--accent-dim);
}

.ic-btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.ic-btn-reset:hover { border-color: var(--border-accent); color: var(--accent); }

.ic-result-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 14px;
}

/* ---- Toast ---- */
.ic-toast {
    position: fixed;
    bottom: 28px; right: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    z-index: 9999;
    max-width: 320px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.35s var(--ease-bounce);
    pointer-events: none;
}

.ic-toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.ic-toast.toast-error { border-color: rgba(248,113,113,0.3); }

.ic-toast-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 12px;
    flex-shrink: 0;
}

.ic-toast.toast-error .ic-toast-icon { background: rgba(248,113,113,0.1); color: #f87171; }

.ic-toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.ic-toast-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.ic-toast.toast-error .ic-toast-type { color: #f87171; }

.ic-toast-msg {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Keyframes ---- */
@keyframes ic-spin { to { transform: rotate(360deg); } }
@keyframes ic-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .ic-ops-row { gap: 6px; }
    .ic-op-btn { padding: 10px 14px; font-size: 12px; }
    .ic-op-hint { display: none; }
    .ic-target-grid { grid-template-columns: repeat(2, 1fr); }
    .ic-panel-right { position: static; }
    .ic-toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}