/* ═══════════════════════════════════════════════════════════
   SiteToSocial Free Tools — Shared Stylesheet
   Matches existing dark theme from index.html
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface-2: #1a1a26;
    --border: #2a2a3a;
    --text: #e8e8ef;
    --text-dim: #8888a0;
    --accent: #E60023;
    --accent-glow: rgba(230, 0, 35, 0.3);
    --green: #22c55e;
    --font: 'DM Sans', sans-serif;
    --mono: 'Space Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── Tool Page Layout ── */
.tool-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.tool-hero {
    text-align: center;
    padding: 100px 0 48px;
    position: relative;
}

.tool-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.3;
}

.tool-badge {
    display: inline-block;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 28px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: heroElFadeIn 0.6s ease 0.15s forwards;
}

.tool-hero h1 {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: heroElFadeIn 0.6s ease 0.3s forwards;
}

.tool-hero h1 .highlight {
    background: linear-gradient(135deg, var(--accent), #ff4060);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-subtitle {
    font-size: 17px;
    color: var(--text-dim);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: heroElFadeIn 0.6s ease 0.45s forwards;
}

@keyframes heroElFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Tool Card ── */
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    margin-bottom: 40px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-row {
    display: flex;
    gap: 12px;
}

.input-row input {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 15px;
    color: var(--text);
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.input-row input:focus {
    border-color: var(--accent);
}

.input-row input::placeholder {
    color: #555;
}

.input-row button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.input-row button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 30px var(--accent-glow);
}

.input-row button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
}

.uses-left {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-dim);
}

.uses-left.low {
    color: #ff6b6b;
}

/* ── Error & Queue Messages ── */
.error-msg {
    background: rgba(255, 50, 50, 0.08);
    border: 1px solid rgba(255, 50, 50, 0.2);
    color: #ff6b6b;
    padding: 14px 18px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 14px;
}

.rate-cta {
    margin-top: 10px;
    color: var(--text-dim);
    font-size: 13px;
}

.rate-cta a {
    color: var(--accent);
    text-decoration: underline;
}

.queue-msg {
    background: rgba(230, 0, 35, 0.06);
    border: 1px solid rgba(230, 0, 35, 0.15);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text);
    font-size: 14px;
}

.queue-spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.queue-cta {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Results ── */
.results {
    margin-top: 28px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.keywords-used {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

.kw-label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kw-tag {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-dim);
    font-family: var(--mono);
}

/* ── Pin Cards (Tool 1) ── */
.pins-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pin-card {
    display: flex;
    gap: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s;
}

.pin-card:hover {
    border-color: #3a3a4a;
}

.pin-number {
    width: 32px; height: 32px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.pin-content {
    flex: 1;
    min-width: 0;
}

.pin-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.pin-title-row h4 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.pin-desc {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 10px;
}

.copy-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-dim);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}

.copy-btn.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--green);
}

.copy-desc {
    margin-top: 4px;
}

/* ── Keywords Grid (Tool 2) ── */
.keywords-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.keyword-chip {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.keyword-chip:hover {
    border-color: var(--accent);
    background: rgba(230, 0, 35, 0.06);
}

.keyword-chip.copied {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.kw-copy {
    font-size: 12px;
    opacity: 0.4;
}

/* ── Hashtags Grid (Tool 3) ── */
.hashtags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.hashtag-chip {
    background: rgba(230, 0, 35, 0.08);
    border: 1px solid rgba(230, 0, 35, 0.15);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #ff6070;
    cursor: pointer;
    transition: all 0.2s;
}

.hashtag-chip:hover {
    background: rgba(230, 0, 35, 0.15);
    border-color: rgba(230, 0, 35, 0.3);
}

.hashtag-chip.copied {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--green);
}

.copy-block {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.copy-block label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 10px;
    display: block;
}

.copy-text {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    line-height: 1.8;
    word-break: break-all;
    margin-bottom: 14px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.copy-all-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.copy-all-btn:hover {
    opacity: 0.9;
}

.copy-all-btn.copied {
    background: var(--green);
}

.copy-all-btn.secondary {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text);
}

.copy-all-btn.secondary:hover {
    background: rgba(255,255,255,0.1);
}

/* ── CTA ── */
.tool-cta {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 32px;
}

.tool-cta h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.tool-cta p {
    color: var(--text-dim);
    font-size: 15px;
    max-width: 480px;
    margin: 0 auto 24px;
    line-height: 1.7;
}

.btn {
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s;
    border: none;
    font-family: var(--font);
    display: inline-block;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 30px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px var(--accent-glow);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .tool-card { padding: 24px 18px; }
    .tool-hero { padding: 80px 0 32px; }

    .input-row {
        flex-direction: column;
    }

    .input-row button {
        justify-content: center;
    }

    .pin-card {
        flex-direction: column;
        gap: 12px;
    }

    .pin-title-row {
        flex-direction: column;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tool-siblings {
        gap: 8px;
    }

    .tool-sibling-pill {
        font-size: 12px;
        padding: 7px 14px;
    }

    .hero-rising-chart {
        width: 160px;
        height: 48px;
    }
}

/* ═══════════════════════════════════════════════════════════
   Related Tools — Cross-linking section
   ═══════════════════════════════════════════════════════════ */

/* Sibling tool pills (tag-style, clearly clickable) */
.tool-siblings {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}
.tool-sibling-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 9px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.tool-sibling-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(230,0,35,0.08), rgba(230,0,35,0.02));
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: inherit;
}
.tool-sibling-pill:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(230,0,35,0.15);
}
.tool-sibling-pill:hover::before {
    opacity: 1;
}
.tool-sibling-pill::after {
    content: '→';
    font-size: 12px;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.25s ease;
}
.tool-sibling-pill:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Rising analytics chart animation in hero */
.hero-rising-chart {
    width: 220px;
    height: 65px;
    margin: 0 auto 20px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: chartFadeIn 1s ease 0.3s forwards;
}
.rising-svg {
    width: 100%;
    height: 100%;
}
.rising-line {
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    animation: drawLine 2s ease 0.5s forwards;
}
.rising-fill {
    opacity: 0;
    animation: fillFadeIn 0.8s ease 1.8s forwards;
}
.rising-dot {
    opacity: 0;
    animation: dotPulse 2s ease 2.2s forwards;
    filter: drop-shadow(0 0 6px rgba(230,0,35,0.6));
}
@keyframes chartFadeIn {
    to { opacity: 1; }
}
@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}
@keyframes fillFadeIn {
    to { opacity: 1; }
}
@keyframes dotPulse {
    0% { opacity: 0; r: 0; }
    40% { opacity: 1; r: 5; }
    60% { r: 3.5; }
    80% { r: 4.5; }
    100% { opacity: 1; r: 4; }
}

/* Bottom related tools cards */
.related-tools {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}
.related-tools h2 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 28px;
    color: var(--text);
}
.related-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.tool-card-link {
    text-decoration: none;
    color: inherit;
}
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.25s ease;
}
.tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.tool-card h4 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 8px;
}
.tool-card p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 12px;
}
.tool-card-arrow {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}
@media (max-width: 600px) {
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}
