/* ═══════════════════════════════════════════════════════════════════
   WAVE 4 IMAGES - Client-side image tools
   Tools: Smart Social Cropper, Image Color Story, Canvas Watermark Batch
   Namespacing: .w4i-* (BEM with w4i- prefix)
═══════════════════════════════════════════════════════════════════ */

.w4i-form { display: grid; gap: 1.25rem; }

.w4i-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-weight: 600;
    font-size: .875rem;
    color: var(--color-text, #111);
    margin-bottom: .375rem;
}
.w4i-label__hint {
    font-weight: 500;
    color: var(--color-text-muted, #6c757d);
    font-size: .8125rem;
}

/* ─── Drop zone ─── */
.w4i-drop {
    position: relative;
    border: 2px dashed var(--bs-border-color, #ced4da);
    border-radius: .75rem;
    padding: 2rem 1.25rem;
    text-align: center;
    background: var(--bs-tertiary-bg, #f8f9fa);
    transition: border-color .15s ease, background-color .15s ease;
    cursor: pointer;
}
.w4i-drop:hover,
.w4i-drop.is-drag {
    border-color: var(--bs-primary, #0d6efd);
    background: rgba(13, 110, 253, .04);
}
.w4i-drop__icon {
    font-size: 2rem;
    color: var(--bs-primary, #0d6efd);
    margin-bottom: .5rem;
}
.w4i-drop__title { font-weight: 600; margin-bottom: .25rem; }
.w4i-drop__hint { color: var(--color-text-muted, #6c757d); font-size: .875rem; }
.w4i-drop__input {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
}

.w4i-privacy {
    display: inline-flex; align-items: center; gap: .375rem;
    color: var(--color-text-muted, #6c757d);
    font-size: .8125rem;
    margin-top: .5rem;
}
.w4i-privacy .bi { color: var(--bs-success, #198754); }

/* ─── Status / progress ─── */
.w4i-status {
    margin: 0;
    font-size: .875rem;
    color: var(--color-text-muted, #6c757d);
}
.w4i-status.is-error { color: var(--bs-danger, #dc3545); }
.w4i-status.is-ok    { color: var(--bs-success, #198754); }

.w4i-progress {
    height: .5rem;
    border-radius: 99px;
    background: rgba(0, 0, 0, .08);
    overflow: hidden;
    margin: .5rem 0;
}
.w4i-progress__bar {
    height: 100%;
    background: var(--bs-primary, #0d6efd);
    width: 0;
    transition: width .15s ease;
}

/* ─── Cropper / Watermark grid ─── */
.w4i-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.w4i-card {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .75rem;
    overflow: hidden;
    background: var(--bs-body-bg, #fff);
    display: flex;
    flex-direction: column;
}
.w4i-card__thumb {
    aspect-ratio: 4 / 3;
    background: #f1f3f5 center/contain no-repeat;
    background-image: linear-gradient(45deg, #f1f3f5 25%, transparent 25%),
                      linear-gradient(-45deg, #f1f3f5 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #f1f3f5 75%),
                      linear-gradient(-45deg, transparent 75%, #f1f3f5 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}
.w4i-card__thumb img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}
.w4i-card__body {
    padding: .625rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .375rem;
}
.w4i-card__title {
    font-weight: 600;
    font-size: .9rem;
    margin: 0;
}
.w4i-card__meta {
    color: var(--color-text-muted, #6c757d);
    font-size: .75rem;
    margin: 0;
}
.w4i-card__actions {
    display: flex;
    gap: .375rem;
    margin-top: .25rem;
}
.w4i-card__actions .btn { flex: 1 1 auto; }

.w4i-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
}
.w4i-toolbar__title {
    font-weight: 600;
    margin: 0;
    margin-right: auto;
}

/* ─── Color story ─── */
.w4i-cs-result {
    border-radius: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    transition: background-color .3s ease;
}
.w4i-cs-mood {
    background: rgba(255, 255, 255, .85);
    border-radius: .75rem;
    padding: 1.25rem;
    backdrop-filter: blur(8px);
    text-align: center;
    margin-bottom: 1rem;
}
.w4i-cs-mood__emoji {
    font-size: 2.25rem;
    line-height: 1;
    margin-bottom: .25rem;
}
.w4i-cs-mood__label {
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
}
.w4i-cs-mood__sub {
    color: #555;
    font-size: .8125rem;
    margin: .25rem 0 0;
}

.w4i-cs-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .5rem;
    margin-bottom: 1rem;
}
.w4i-cs-swatch {
    border-radius: .625rem;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}
.w4i-cs-swatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}
.w4i-cs-swatch__chip {
    height: 70px;
}
.w4i-cs-swatch__info {
    padding: .5rem .625rem;
    font-size: .75rem;
    line-height: 1.4;
}
.w4i-cs-swatch__hex {
    font-weight: 700;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: .8125rem;
}
.w4i-cs-swatch__rgb,
.w4i-cs-swatch__hsl {
    color: #6c757d;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: .6875rem;
}
.w4i-cs-snippet {
    background: #1e1e2e;
    color: #f1f1f1;
    border-radius: .625rem;
    padding: 1rem;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: .8125rem;
    overflow-x: auto;
    position: relative;
    margin-bottom: 1rem;
    white-space: pre;
}
.w4i-cs-snippet__copy {
    position: absolute;
    top: .5rem; right: .5rem;
}
.w4i-cs-image-preview {
    max-width: 100%;
    max-height: 220px;
    border-radius: .5rem;
    margin-bottom: 1rem;
    display: block;
}

/* ─── Watermark inputs ─── */
.w4i-wm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .25rem;
    width: 132px;
}
.w4i-wm-grid__cell {
    aspect-ratio: 1;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: #fff;
    border-radius: .375rem;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
    padding: 0;
}
.w4i-wm-grid__cell:hover { background: rgba(13, 110, 253, .08); }
.w4i-wm-grid__cell.is-active {
    border-color: var(--bs-primary, #0d6efd);
    background: var(--bs-primary, #0d6efd);
}

.w4i-wm-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: end;
}

.w4i-card__compare {
    position: relative;
}
.w4i-card__compare-tag {
    position: absolute;
    top: .375rem; left: .375rem;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    padding: .125rem .375rem;
    border-radius: .25rem;
    font-size: .6875rem;
    pointer-events: none;
}
