/* ==========================================================================
   Wibushi - Ferramentas de Cor (paletas, contraste, conversor, extracao)
   Depende de: bootstrap 4, remixicon
   ========================================================================== */

.wb-tool {
    --wb-slate: #515D7D;
    --wb-ink: #242A3A;
    --wb-line: #e3e6ee;
}

/* --------------------------------------------------------- input da cor */
.wb-color-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.wb-color-field .wb-color-well {
    position: relative;
    flex: 0 0 52px;
    width: 52px;
    height: 42px;
    border: 1px solid var(--wb-line, #e3e6ee);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}
.wb-color-field .wb-color-well input[type="color"] {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 200%;
    height: 200%;
    padding: 0;
    border: none;
    cursor: pointer;
}
.wb-color-field input[type="text"] {
    height: 42px;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    text-transform: uppercase;
}
.wb-color-field input[type="text"].is-invalid {
    border-color: #dc3545;
}

/* --------------------------------------------------------- swatches */
.wb-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.wb-swatch {
    position: relative;
    flex: 1 1 92px;
    min-width: 92px;
    max-width: 160px;
    border: 1px solid var(--wb-line, #e3e6ee);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.wb-swatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(36, 42, 58, .14);
}
.wb-swatch:focus {
    outline: 2px solid var(--wb-slate, #515D7D);
    outline-offset: 2px;
}
.wb-swatch-chip {
    height: 78px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 6px 8px;
}
.wb-swatch-role {
    font-size: 11px;
    line-height: 1.1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    opacity: .85;
}
.wb-swatch-meta {
    padding: 6px 8px;
    border-top: 1px solid var(--wb-line, #e3e6ee);
}
.wb-swatch-hex {
    display: block;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--wb-ink, #242A3A);
    margin: 0;
}
.wb-swatch-sub {
    display: block;
    font-size: 11px;
    color: #6c757d;
    margin: 0;
}
.wb-swatch.is-copied .wb-swatch-chip::after {
    content: "Copiado!";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(36, 42, 58, .82);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

/* --------------------------------------------------------- grupos/harmonias */
.wb-harmony {
    border: 1px solid var(--wb-line, #e3e6ee);
    border-radius: 8px;
    background: #fff;
    padding: 16px;
    margin-bottom: 16px;
}
.wb-harmony-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.wb-harmony-head h3 {
    font-size: 17px;
    margin: 0 0 2px;
}
.wb-harmony-head p {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
}

/* --------------------------------------------------------- contraste */
.wb-contrast-preview {
    border: 1px solid var(--wb-line, #e3e6ee);
    border-radius: 8px;
    padding: 24px;
}
.wb-contrast-preview .wb-sample-normal {
    font-size: 16px;
    line-height: 1.55;
    margin-bottom: 12px;
}
.wb-contrast-preview .wb-sample-large {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}
.wb-contrast-preview .wb-sample-small {
    font-size: 13px;
    margin-bottom: 0;
}
.wb-ratio {
    font-size: 46px;
    font-weight: 900;
    line-height: 1;
    color: var(--wb-ink, #242A3A);
}
.wb-ratio-label {
    font-size: 13px;
    color: #6c757d;
}
.wb-checks {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}
.wb-checks li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--wb-line, #e3e6ee);
    font-size: 14px;
}
.wb-checks li:last-child {
    border-bottom: none;
}
.wb-checks .wb-check-name small {
    display: block;
    color: #6c757d;
    font-size: 12px;
}
.wb-badge {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.wb-badge-pass {
    background: #d4f4e2;
    color: #12664a;
}
.wb-badge-fail {
    background: #fadcdd;
    color: #8e1c25;
}

/* --------------------------------------------------------- conversor */
.wb-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.wb-value {
    border: 1px solid var(--wb-line, #e3e6ee);
    border-radius: 6px;
    background: #fff;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.wb-value-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    margin: 0 0 2px;
}
.wb-value-text {
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--wb-ink, #242A3A);
    margin: 0;
    word-break: break-all;
}
.wb-value .btn {
    flex: 0 0 auto;
}
.wb-big-preview {
    height: 120px;
    border: 1px solid var(--wb-line, #e3e6ee);
    border-radius: 8px;
}

/* --------------------------------------------------------- extracao */
.wb-dropzone {
    border: 2px dashed var(--wb-slate, #515D7D);
    border-radius: 8px;
    background: #fff;
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: background .15s ease;
}
.wb-dropzone.is-over {
    background: #eef1f7;
}
.wb-dropzone p {
    margin: 0;
    color: #6c757d;
}
.wb-pdf-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--wb-line, #e3e6ee);
    border-radius: 6px;
}
.wb-source-tag {
    display: inline-block;
    font-size: 11px;
    color: #6c757d;
    border: 1px solid var(--wb-line, #e3e6ee);
    border-radius: 20px;
    padding: 1px 8px;
}
.wb-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wb-spin .7s linear infinite;
    vertical-align: -3px;
}
@keyframes wb-spin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------- ponte para o app */
.wb-tool-cta {
    border: 1px solid var(--wb-line, #e3e6ee);
    border-left: 4px solid var(--wb-slate, #515D7D);
    border-radius: 8px;
    background: #f7f8fb;
    padding: 20px 24px;
}
.wb-tool-cta h3 {
    font-size: 19px;
    margin: 0 0 6px;
}
.wb-tool-cta p {
    margin: 0 0 14px;
    color: #4a5169;
}

/* --------------------------------------------------------- toast */
.wb-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(10px);
    background: var(--wb-ink, #242A3A);
    color: #fff;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(36, 42, 58, .28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 2000;
}
.wb-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
