/**
 * Shared styles for the Wave 6 image tools (Image Compressor, WebP
 * Converter, Image Optimizer, Favicon Generator). Per-tool accent is
 * injected as --it-accent* by each tool's index.php.
 */
:root { --it-accent: #0d9488; --it-accent-dark: #0f766e; --it-accent-tint: #ccfbf1; }

.page-hero h1 .it-hero-mark { width: 1em; height: 1em; vertical-align: -0.12em; margin-right: 0.4rem; color: var(--it-accent); }

.it-intro { margin: 0 0 16px; color: #475569; font-size: 0.95rem; line-height: 1.5; }

/* ---- Dropzone ---- */
.it-dropzone {
    border: 2px dashed #cbd5e1; border-radius: 14px; background: #fbfcfe;
    padding: 34px 20px; text-align: center; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.it-dropzone:hover, .it-dropzone.is-drag { border-color: var(--it-accent); background: var(--it-accent-tint); }
.it-dz-icon { color: var(--it-accent); margin-bottom: 8px; }
.it-dz-text { font-weight: 600; color: #334155; font-size: 1rem; pointer-events: none; }
.it-dz-sub { color: #94a3b8; font-size: 0.85rem; margin-top: 4px; pointer-events: none; }
.it-dropzone input[type="file"] { display: none; }
/* Transient "skipped non-image files" notice injected by image-tools.js. */
.it-drop-notice { color: #b91c1c; font-size: 0.85rem; margin-top: 8px; pointer-events: none; }
.it-drop-notice[hidden] { display: none; }

/* ---- Controls ---- */
.it-controls {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 18px;
    margin-top: 18px; padding-top: 16px; border-top: 1px solid #eef0f4;
}
.it-control { display: flex; flex-direction: column; gap: 6px; }
/* Mode-switched control groups (Image Resizer) toggle via [hidden]; the
 * flex display above would otherwise beat the UA hidden rule. */
.it-control[hidden] { display: none; }
/* Checkbox row inside a control (e.g. "Keep aspect ratio"). */
.it-check { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: #1f2937; cursor: pointer; padding: 9px 0; }
.it-check input { accent-color: var(--it-accent); width: 16px; height: 16px; margin: 0; }
.it-control-label { font-weight: 600; font-size: 0.85rem; color: #334155; display: flex; justify-content: space-between; }
.it-control-label .it-val { color: var(--it-accent-dark); font-variant-numeric: tabular-nums; }
.it-range { width: 100%; accent-color: var(--it-accent); }
.it-select, .it-num {
    width: 100%; box-sizing: border-box; font: inherit; font-size: 0.92rem; padding: 9px 11px;
    border: 1px solid #d7dbe0; border-radius: 8px; background: #fff; color: #1f2937;
}
.it-select:focus, .it-num:focus { outline: 2px solid var(--it-accent); border-color: var(--it-accent); }

.it-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.it-actions[hidden] { display: none; }
.it-actions .primary-btn { background: var(--it-accent); border-color: var(--it-accent); }
.it-actions .primary-btn:hover { background: var(--it-accent-dark); border-color: var(--it-accent-dark); color: #fff; }

/* ---- Result list ---- */
.it-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.it-card {
    display: flex; align-items: center; gap: 14px;
    border: 1px solid #e7eaf0; border-radius: 12px; background: #fff; padding: 12px 14px;
}
.it-thumb {
    width: 64px; height: 64px; flex: 0 0 64px; border-radius: 8px; overflow: hidden;
    background: repeating-conic-gradient(#eef2f6 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    display: flex; align-items: center; justify-content: center;
}
.it-thumb img { max-width: 100%; max-height: 100%; display: block; }
.it-meta { flex: 1 1 auto; min-width: 0; }
.it-name { font-weight: 600; color: #1f2937; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it-stats { font-size: 0.85rem; color: #64748b; margin-top: 3px; font-variant-numeric: tabular-nums; }
.it-arrow { color: #cbd5e1; }
.it-size-to { font-weight: 700; color: #1f2937; }
.it-delta { font-weight: 700; margin-left: 6px; }
.it-good .it-delta { color: #15803d; }
.it-bad .it-delta { color: #b91c1c; }
.it-good .it-size-to { color: #15803d; }
.it-dims { display: block; color: #94a3b8; font-size: 0.78rem; margin-top: 2px; }
.it-card-actions { flex: 0 0 auto; }
.it-dl { padding: 8px 16px; font-size: 0.88rem; }
.it-spin {
    width: 22px; height: 22px; border: 3px solid var(--it-accent-tint); border-top-color: var(--it-accent);
    border-radius: 50%; animation: it-spin 0.8s linear infinite;
}
@keyframes it-spin { to { transform: rotate(360deg); } }

/* ---- Favicon grid ---- */
.fv-result { margin-top: 18px; }
.fv-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; }
.fv-item {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    border: 1px solid #e7eaf0; border-radius: 10px; padding: 12px; background: #fff;
}
/* Fixed-height preview slot: every widget is the same height regardless of the
 * icon's display size (16px up to the 72px-capped large icons), so the labels
 * AND the PNG buttons line up across all sizes instead of riding the image. */
.fv-preview { height: 72px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.fv-item canvas, .fv-item img {
    display: block;
    background: repeating-conic-gradient(#eef2f6 0% 25%, #fff 0% 50%) 50% / 12px 12px;
    image-rendering: -webkit-optimize-contrast;
}
.fv-item-label { font-size: 0.8rem; color: #64748b; margin-bottom: 8px; }
/* Pin the download to the bottom so buttons align even if a label wraps (cards
 * stretch to equal height in the flex row). */
.fv-item .it-dl { margin-top: auto; padding: 5px 10px; font-size: 0.8rem; }
.fv-snippet { margin-top: 18px; }
.fv-snippet-label { font-weight: 700; font-size: 0.9rem; color: var(--it-accent-dark); margin-bottom: 6px; }
.fv-snippet pre {
    margin: 0; background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 14px 16px;
    overflow-x: auto; font-size: 0.82rem; line-height: 1.5;
}

@media (max-width: 560px) {
    .it-card { flex-wrap: wrap; }
    .it-card-actions { flex-basis: 100%; }
    .it-dl { width: 100%; }
    .it-actions .primary-btn, .it-actions .ghost-btn { width: 100%; }
}
