/* =========================================================
   Hashtag Finder — "Tag Cloud" theme
   Scoped, prefixed styles (htf-*) for this page only.
   ========================================================= */

:root {
    --htf-red: #dc2626;
    --htf-red-soft: rgba(220, 38, 38, 0.14);
    --htf-red-line: rgba(220, 38, 38, 0.45);
    --htf-cyan: #22d3ee;
    --htf-cyan-soft: rgba(34, 211, 238, 0.14);
    --htf-cyan-line: rgba(34, 211, 238, 0.45);
    --htf-ink: #f4f4f5;
    --htf-dim: #9c9ca4;
    --htf-card: #0a0a0c;
    --htf-card-2: #060607;
    --htf-line: #232327;
}

/* ---------- Page background ---------- */
.htf-bg {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 8%, var(--htf-red-soft), transparent 32%),
        radial-gradient(circle at 88% 18%, var(--htf-cyan-soft), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.04), transparent 30%),
        linear-gradient(180deg, #070707 0%, #030303 100%);
}

.htf-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, black 0%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, black 0%, transparent 75%);
    pointer-events: none;
}

/* ---------- Hero badge ---------- */
.htf-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px dashed var(--htf-red-line);
    background: var(--htf-red-soft);
    color: #fca5a5;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    transform: rotate(-1.5deg);
}

.htf-badge i {
    color: var(--htf-red);
}

/* ---------- Floating decorative tag cluster ---------- */
.htf-floaters {
    pointer-events: none;
    position: absolute;
    inset: -1.5rem -1rem auto auto;
    z-index: 0;
}

.htf-floaters span {
    position: absolute;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--htf-line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--htf-dim);
    animation: htf-drift 6s ease-in-out infinite;
}

.htf-floaters span:nth-child(1) { top: 0; right: 6.5rem; animation-delay: 0s; color: #fca5a5; border-color: var(--htf-red-line); background: var(--htf-red-soft); }
.htf-floaters span:nth-child(2) { top: 3.25rem; right: 0; animation-delay: 0.6s; }
.htf-floaters span:nth-child(3) { top: 6rem; right: 8.5rem; animation-delay: 1.2s; color: #67e8f9; border-color: var(--htf-cyan-line); background: var(--htf-cyan-soft); }
.htf-floaters span:nth-child(4) { top: 9.25rem; right: 1.5rem; animation-delay: 1.8s; font-size: 0.7rem; }

@keyframes htf-drift {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

/* ---------- Tier legend strip (hero) ---------- */
.htf-legend {
    display: grid;
    gap: 0.75rem;
}

.htf-legend-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--htf-line);
    background: var(--htf-card);
    border-radius: 1.25rem;
    padding: 0.85rem 1.1rem;
}

.htf-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.htf-dot--broad { background: #71717a; }
.htf-dot--medium { background: var(--htf-red); }
.htf-dot--niche { background: var(--htf-cyan); }

.htf-legend-row b {
    color: var(--htf-ink);
    font-weight: 700;
    margin-right: 0.35rem;
}

.htf-legend-row span.htf-legend-text {
    color: var(--htf-dim);
    font-size: 0.9rem;
}

/* ---------- Demo card ---------- */
.htf-card {
    position: relative;
    border: 1px solid var(--htf-line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%), var(--htf-card);
    border-radius: 2rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.htf-live-dot {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--htf-cyan);
    box-shadow: 0 0 0 3px var(--htf-cyan-soft);
    animation: htf-pulse 1.6s ease-in-out infinite;
}

@keyframes htf-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.htf-input {
    width: 100%;
    border-radius: 0.9rem;
    border: 1px solid var(--htf-line);
    background: #000;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    color: var(--htf-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.htf-input::placeholder { color: #52525b; }

.htf-input:focus {
    outline: none;
    border-color: var(--htf-red);
    box-shadow: 0 0 0 3px var(--htf-red-soft);
}

/* ---------- Output / tag cloud panel ---------- */
.htf-output {
    position: relative;
    border-radius: 1.5rem;
    border: 1px solid var(--htf-line);
    background:
        radial-gradient(circle at 15% 20%, rgba(220, 38, 38, 0.05), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(34, 211, 238, 0.05), transparent 40%),
        var(--htf-card-2);
    padding: 1.25rem;
    min-height: 280px;
    max-height: 420px;
    overflow-y: auto;
}

.htf-placeholder {
    color: #71717a;
    font-size: 0.9rem;
}

.htf-tier-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--htf-dim);
    margin-bottom: 0.6rem;
}

.htf-tier {
    margin-bottom: 1.1rem;
}

.htf-tier:last-of-type {
    margin-bottom: 0;
}

.htf-tier-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* Individual tag pill — base */
.htf-pill {
    --r: 0deg;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    transform: rotate(var(--r));
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.htf-tier-pills > .htf-pill:nth-child(3n+1) { --r: -2.5deg; }
.htf-tier-pills > .htf-pill:nth-child(3n+2) { --r: 2deg; }
.htf-tier-pills > .htf-pill:nth-child(3n) { --r: -1deg; }

.htf-pill:hover,
.htf-pill:focus-visible {
    transform: rotate(var(--r)) translateY(-4px) scale(1.08);
}

.htf-pill:active {
    transform: rotate(var(--r)) translateY(-1px) scale(0.97);
}

/* Weight per tier: broad = lightest, medium = mid, niche = heaviest/most saturated */
.htf-pill[data-tier="broad"] {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
    font-weight: 500;
    color: #a1a1aa;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--htf-line);
    opacity: 0.85;
}

.htf-pill[data-tier="broad"]:hover {
    border-color: #52525b;
    color: #d4d4d8;
}

.htf-pill[data-tier="medium"] {
    font-size: 0.86rem;
    padding: 0.45rem 0.85rem;
    font-weight: 600;
    color: #fca5a5;
    background: var(--htf-red-soft);
    border: 1px solid var(--htf-red-line);
}

.htf-pill[data-tier="medium"]:hover {
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.18);
}

.htf-pill[data-tier="niche"] {
    font-size: 0.95rem;
    padding: 0.5rem 0.95rem;
    font-weight: 700;
    color: #a5f3fc;
    background: var(--htf-cyan-soft);
    border: 1px solid var(--htf-cyan-line);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.08);
}

.htf-pill[data-tier="niche"]:hover {
    box-shadow: 0 8px 20px rgba(34, 211, 238, 0.2);
}

.htf-pill .fa-copy {
    margin-left: 0.4rem;
    font-size: 0.7em;
    opacity: 0.55;
}

.htf-hint {
    font-size: 0.75rem;
    color: #71717a;
    border-top: 1px solid var(--htf-line);
    padding-top: 0.75rem;
    margin-top: 0.35rem;
}

/* ---------- Buttons ---------- */
.htf-btn-primary {
    border-radius: 999px;
    background: var(--htf-red);
    color: #fff;
    font-weight: 600;
    padding: 1rem 1.5rem;
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.22);
}

.htf-btn-primary:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.htf-btn-secondary {
    border-radius: 999px;
    border: 1px solid var(--htf-line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--htf-ink);
    font-weight: 600;
    padding: 1rem 1.5rem;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.htf-btn-secondary:hover {
    border-color: var(--htf-cyan);
    color: #a5f3fc;
    transform: translateY(-1px);
}

/* ---------- Toast ---------- */
.htf-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    border-radius: 999px;
    background: var(--htf-red);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 20px 45px rgba(220, 38, 38, 0.3);
    z-index: 100;
    animation: htf-toast-in 0.18s ease;
}

@keyframes htf-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Content panels ---------- */
.htf-panel {
    border: 1px solid var(--htf-line);
    background: var(--htf-card);
    border-radius: 1.75rem;
}

.htf-tier-card {
    border-radius: 1.5rem;
    border: 1px solid var(--htf-line);
    background: var(--htf-card);
    padding: 1.5rem;
}

.htf-tier-card[data-tier="broad"] { border-color: var(--htf-line); }
.htf-tier-card[data-tier="medium"] { border-color: var(--htf-red-line); }
.htf-tier-card[data-tier="niche"] { border-color: var(--htf-cyan-line); }

.htf-sample-pill {
    display: inline-flex;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    margin-bottom: 0.9rem;
}

.htf-sample-pill[data-tier="broad"] { color: #a1a1aa; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--htf-line); }
.htf-sample-pill[data-tier="medium"] { color: #fca5a5; background: var(--htf-red-soft); border: 1px solid var(--htf-red-line); }
.htf-sample-pill[data-tier="niche"] { color: #a5f3fc; background: var(--htf-cyan-soft); border: 1px solid var(--htf-cyan-line); }

.htf-mini-card {
    border-radius: 1.5rem;
    border: 1px solid var(--htf-line);
    background: #000;
    padding: 1.4rem;
}

.htf-mini-card i {
    color: var(--htf-cyan);
}

.htf-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.htf-step-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    background: var(--htf-red-soft);
    border: 1px solid var(--htf-red-line);
    color: #fca5a5;
    font-weight: 700;
    font-size: 0.85rem;
}

@media (max-width: 767px) {
    .htf-floaters { display: none; }
}
