/* ════════════════════════════════════════
   HASH GENERATOR — Tool Styles
   ════════════════════════════════════════ */
.hash-gen-section {
    --tool-accent: #6366F1;
    --tool-accent-rgb: 99, 102, 241;
}

/* ════════════════════════════════════════
   MODE TABS
   ════════════════════════════════════════ */
.hg-mode-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    margin: 1.5rem 1.5rem 0;
    background: rgba(var(--tool-accent-rgb), 0.06);
    border: 1px solid rgba(var(--tool-accent-rgb), 0.18);
}

.hg-mode-tabs::-webkit-scrollbar {
    display: none;
}

.hg-mode-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--tool-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, color 0.18s;
}

.hg-mode-tab--active {
    background: var(--tool-accent);
    color: #fff;
}

.hg-mode-tab:not(.hg-mode-tab--active):hover {
    background: rgba(var(--tool-accent-rgb), 0.08);
    color: var(--tool-text-primary);
}

/* ════════════════════════════════════════
   SOURCE TABS (Text / File)
   ════════════════════════════════════════ */
.hg-source-tabs {
    display: flex;
    gap: 4px;
    padding: 3px;
    border-radius: 8px;
    width: fit-content;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid var(--tool-border);
    margin: 1rem 1.5rem 0;
}

.hg-source-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--tool-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.hg-source-tab--active {
    background: var(--tool-accent);
    color: #fff;
}

.hg-source-tab:not(.hg-source-tab--active):hover {
    background: rgba(var(--tool-accent-rgb), 0.08);
    color: var(--tool-text-primary);
}

/* Inside verify wrap, no extra margin (parent already has padding) */
.hg-verify-wrap .hg-source-tabs {
    margin: 0;
}

/* ════════════════════════════════════════
   TOGGLE
   ════════════════════════════════════════ */
.hash-gen-section button.tool-toggle {
    position: relative;
    width: 42px;
    height: 24px;
    min-width: 42px;
    border: none;
    border-radius: 12px;
    background: rgba(100, 116, 139, 0.22);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: background 0.2s;
}

.hash-gen-section button.tool-toggle[data-on="true"] {
    background: var(--tool-accent);
}

.hash-gen-section button.tool-toggle .tool-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s;
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.hash-gen-section button.tool-toggle[data-on="true"] .tool-toggle-thumb {
    left: 21px;
    transform: none;
}

/* ════════════════════════════════════════
   INNER SPACING
   ════════════════════════════════════════ */
#hg-generator-section .tool-options-bar {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

#hg-text-pane {
    margin: 1.25rem 1.5rem 0;
}

.hg-generate-wrap {
    padding: 1rem 1.5rem 0;
}

.hg-drop-zone {
    margin: 1rem 1.5rem 0;
}

.hg-results-wrap {
    margin: 1.25rem 1.5rem;
}

#hg-status {
    margin: 0 1.5rem 1.5rem;
}

/* ════════════════════════════════════════
   HMAC KEY INPUT
   ════════════════════════════════════════ */
.hg-key-input {
    width: 220px;
}

/* ════════════════════════════════════════
   DROP ZONE
   ════════════════════════════════════════ */
.hg-drop-zone {
    border: 2px dashed var(--tool-border);
    border-radius: var(--tool-radius-sm);
    padding: 1.25rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
    position: relative;
}

.hg-drop-zone:hover,
.hg-drop-zone:focus,
.hg-drop-zone--over {
    border-color: var(--tool-accent);
    background: rgba(var(--tool-accent-rgb), 0.04);
    outline: none;
}

.hg-drop-icon {
    display: block;
    font-size: 1.75rem;
    color: var(--tool-text-muted);
    margin-bottom: 0.4rem;
}

.hg-drop-label {
    display: block;
    font-size: 0.9375rem;
    color: var(--tool-text-secondary);
    margin-bottom: 0.25rem;
}

.hg-drop-browse {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tool-accent);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0;
    text-decoration: underline;
}

.hg-drop-browse:hover {
    opacity: 0.8;
}

.hg-drop-hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--tool-text-muted);
}

.hg-drop-zone--sm {
    padding: 0.75rem 1.5rem;
}

.hg-drop-zone--sm .hg-drop-icon {
    display: none;
}

/* ── File info panel ── */
.hg-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.hg-file-name-text {
    font-size: 0.9375rem;
    color: var(--tool-accent);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-file-size-text {
    font-size: 0.875rem;
    color: var(--tool-text-muted);
}

.hg-file-clear {
    background: none;
    border: none;
    color: var(--tool-text-muted);
    cursor: pointer;
    font-size: 0.9375rem;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

.hg-file-clear:hover {
    color: #ef4444;
}

/* ════════════════════════════════════════
   RESULTS
   ════════════════════════════════════════ */
.hg-results {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.hg-result-item {
    background: var(--tool-surface);
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius-sm);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.hg-result-algo-wrap {
    display: flex;
    flex-direction: column;
    min-width: 80px;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.hg-result-algo {
    font-size: 0.9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tool-accent);
    line-height: 1.2;
}

.hg-result-bits {
    font-size: 0.75rem;
    color: var(--tool-text-muted);
    margin-top: 0.1rem;
}

.hg-result-hash {
    font-family: var(--tool-font-mono);
    font-size: 1rem;
    color: var(--tool-text-primary);
    word-break: break-all;
    flex: 1;
}

.hg-result-copy {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tool-text-muted);
    font-size: 0.9375rem;
    padding: 0.15rem;
    border-radius: 4px;
    transition: color 0.15s;
}

.hg-result-copy:hover {
    color: var(--tool-accent);
}

.hg-computing {
    color: var(--tool-text-muted);
    font-size: 1rem;
    padding: 0.5rem 0;
}

.hg-empty-hint {
    color: var(--tool-text-muted);
    font-size: 0.9375rem;
    padding: 0.5rem 0;
}

/* Results actions bar */
.hg-results-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--tool-border);
}

/* ════════════════════════════════════════
   VERIFY TAB
   ════════════════════════════════════════ */
.hg-verify-wrap {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hg-verify-fields {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.hg-verify-algo-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 140px;
}

.hg-verify-known-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 200px;
}

.hg-verify-known-input {
    width: 100%;
}

.hg-verify-actions {
    display: flex;
}

.hg-verify-result {
    border-radius: var(--tool-radius-sm);
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    border: 1px solid transparent;
}

.hg-verify-result--match {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.35);
    color: #16a34a;
}

.hg-verify-result--mismatch {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
    color: #dc2626;
}

.hg-verify-result strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hg-verify-code {
    font-family: var(--tool-font-mono);
    font-size: 0.875rem;
    word-break: break-all;
    display: block;
    margin-top: 0.25rem;
}

.hg-verify-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.75;
    margin-top: 0.75rem;
}

.hg-verify-result--match .hg-verify-code {
    color: #15803d;
}

.hg-verify-result--mismatch .hg-verify-code {
    color: #b91c1c;
}

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */
@media (max-width: 640px) {
    .hg-mode-tabs {
        margin: 1rem 1rem 0;
    }

    .hg-source-tabs {
        margin: 0.75rem 1rem 0;
    }

    .hg-verify-wrap .hg-source-tabs {
        margin: 0;
    }

    #hg-generator-section .tool-options-bar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    #hg-text-pane {
        margin: 1rem 1rem 0;
    }

    .hg-drop-zone {
        margin: 0.75rem 1rem 0;
    }

    .hg-results-wrap {
        margin: 1rem 1rem;
    }

    #hg-status {
        margin: 0 1rem 1rem;
    }

    .hg-verify-wrap {
        padding: 1rem;
    }

    .hg-verify-fields {
        flex-direction: column;
    }

    .hg-verify-known-wrap {
        min-width: unset;
    }

    .hg-key-input {
        width: 100%;
    }

    .hg-result-hash {
        font-size: 0.875rem;
    }
}
}