/* ===== RESIZE OPTIONS PANEL ===== */
.resize-options {
    background: var(--c-surface);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 20px;
}

/* ===== TABS ===== */
.resize-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--c-border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.resize-tab-btn {
    background: none;
    border: none;
    padding: 8px 18px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .88rem;
    color: var(--c-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: color .18s, border-color .18s, background .18s;
}

.resize-tab-btn:hover {
    color: var(--c-primary);
    background: rgba(240,114,38,.06);
}

.resize-tab-btn.active {
    color: var(--c-primary);
    border-bottom-color: var(--c-primary);
    background: rgba(240,114,38,.05);
}

/* ===== TAB PANELS ===== */
.resize-tab-panel {
    display: none;
}

.resize-tab-panel.active {
    display: block;
}

/* ===== CUSTOM SIZE PANEL ===== */
.resize-input-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.resize-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 100px;
}

.resize-input-group label {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .82rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
}

.resize-input-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: .95rem;
    color: var(--c-text);
    background: var(--c-bg);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    -moz-appearance: textfield;
}

.resize-input-group input[type="number"]::-webkit-inner-spin-button,
.resize-input-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.resize-input-group input[type="number"]:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(240,114,38,.12);
}

.resize-dim-sep {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--c-text-muted);
    padding-bottom: 8px;
    flex-shrink: 0;
}

/* ===== LOCK RATIO ===== */
.resize-lock-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.resize-lock-row label {
    font-family: var(--font-head);
    font-size: .88rem;
    font-weight: 600;
    color: var(--c-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.lock-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 20px;
    background: var(--c-border);
    border-radius: 99px;
    cursor: pointer;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}

.lock-toggle::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: transform .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

.lock-toggle:checked {
    background: var(--c-primary);
}

.lock-toggle:checked::after {
    transform: translateX(16px);
}

/* ===== PERCENT PANEL ===== */
.percent-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.percent-row .resize-input-group {
    max-width: 140px;
}

.percent-quick-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 12px;
}

.percent-quick {
    padding: 6px 14px;
    background: rgba(240,114,38,.08);
    border: 1px solid rgba(240,114,38,.2);
    border-radius: 99px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: .82rem;
    color: var(--c-primary-d);
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .12s;
}

.percent-quick:hover {
    background: rgba(240,114,38,.16);
    border-color: rgba(240,114,38,.4);
    transform: translateY(-1px);
}

.percent-quick.active {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}

/* ===== PRESET GRID ===== */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.preset-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--c-bg);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color .18s, background .18s, transform .12s, box-shadow .18s;
    user-select: none;
}

.preset-card:hover {
    border-color: rgba(240,114,38,.35);
    background: rgba(240,114,38,.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240,114,38,.08);
}

.preset-card.active {
    border-color: var(--c-primary);
    background: rgba(240,114,38,.07);
    box-shadow: 0 0 0 3px rgba(240,114,38,.12);
}

.preset-card-icon {
    width: 32px;
    height: 32px;
    background: rgba(240,114,38,.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--c-primary);
}

.preset-card-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: .82rem;
    color: var(--c-text);
    line-height: 1.25;
}

.preset-card-dims {
    font-size: .75rem;
    color: var(--c-text-muted);
    margin-top: 2px;
}

/* ===== OUTPUT FORMAT ROW ===== */
.resize-format-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.resize-format-row label {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .82rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
    white-space: nowrap;
}

.resize-format-select {
    padding: 8px 14px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: .9rem;
    color: var(--c-text);
    background: var(--c-bg);
    outline: none;
    cursor: pointer;
    transition: border-color .18s;
}

.resize-format-select:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(240,114,38,.12);
}

/* ===== ACTION BUTTON AREA ===== */
.resize-btn-area {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.btn-resize {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent2));
    color: #fff;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1rem;
    border: none;
    border-radius: 99px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(240,114,38,.32);
    transition: opacity .18s, transform .15s, box-shadow .18s;
    white-space: nowrap;
}

.btn-resize:hover {
    opacity: .92;
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(240,114,38,.38);
}

.btn-resize:active {
    transform: translateY(0);
}

/* ===== RESIZE SPINNER OVERLAY ===== */
.resize-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(240,114,38,.2);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== PREVIEW CARD GRID ===== */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media(min-width:480px)  { .preview-grid { grid-template-columns: repeat(3, 1fr); } }
@media(min-width:768px)  { .preview-grid { grid-template-columns: repeat(4, 1fr); } }
@media(min-width:992px)  { .preview-grid { grid-template-columns: repeat(6, 1fr); } }
@media(min-width:1200px) { .preview-grid { grid-template-columns: repeat(8, 1fr); } }

.preview-card {
    background: var(--c-surface);
    border: 1.5px solid rgba(240,114,38,.12);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}
.preview-card:hover {
    border-color: rgba(240,114,38,.3);
    box-shadow: 0 4px 20px rgba(240,114,38,.1);
}

.pc-thumb {
    aspect-ratio: 1/1;
    overflow: hidden;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 0 0 / 12px 12px;
    position: relative;
}
.pc-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .35s ease;
}
.preview-card:hover .pc-thumb img { transform: scale(1.05); }

.pc-remove {
    position: absolute; top: 5px; right: 5px;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(0,0,0,.55); color: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: .65rem;
    opacity: 0; transition: var(--transition); z-index: 2;
}
.preview-card:hover .pc-remove { opacity: 1; }
.pc-remove:hover { background: var(--c-red); transform: scale(1.1); }

.pc-meta {
    padding: 7px 9px 9px;
}
.pc-name {
    font-family: var(--font-head); font-weight: 600; font-size: .72rem;
    color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%;
}
.pc-size {
    font-size: .68rem; color: var(--c-text-muted); margin-top: 2px;
}
.pc-dims {
    font-size: .65rem; color: var(--c-text-muted); margin-top: 1px; opacity: .8;
}
.pc-ext-badge {
    position: absolute; top: 5px; right: 5px;
    background: rgba(0,0,0,.52); color: #fff;
    font-size: .62rem; font-weight: 700; letter-spacing: .5px;
    padding: 2px 6px; border-radius: 4px; pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .resize-input-row {
        flex-direction: column;
        align-items: stretch;
    }
    .resize-dim-sep {
        display: none;
    }
    .preset-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== FORMAT-SPECIFIC NOTE (SEO + credibility, format hero only) ===== */
.format-note {
    max-width: 640px;
    margin: 14px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--c-border);
    font-size: .9rem;
    line-height: 1.7;
    color: var(--c-text-2);
}
@media (max-width: 575.98px) {
    .format-note {
        font-size: .86rem;
        margin-top: 12px;
        padding-top: 10px;
    }
}
