/* ==========================================================================
   FREE TOOLS – Rebelgrowth
   Dedicated stylesheet for /free-tools and /free-tools/<slug> pages.
   Design language: dark accents, #fbc100 gold, system fonts, max-width 1200px.
   ========================================================================== */

/* ── Layout ─────────────────────────────────────────────────────────────── */
.ft-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ── Parent Page: Hero ──────────────────────────────────────────────────── */
.ft-hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.ft-hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.ft-hero p {
    font-size: 1.1rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Category Sections ──────────────────────────────────────────────────── */
.ft-category-section {
    margin-bottom: 3rem;
}

.ft-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

.ft-category-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.ft-category-header p {
    font-size: 0.9rem;
    color: #777;
    margin: 0;
}

/* ── Tool Cards Grid (parent page) ──────────────────────────────────────── */
.ft-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.ft-tool-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ft-tool-card:hover {
    border-color: #fbc100;
    box-shadow: 0 4px 16px rgba(251, 193, 0, 0.12);
    transform: translateY(-2px);
}

.ft-tool-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.4rem;
}

.ft-tool-card p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.ft-tool-card .ft-card-platform {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fbc100;
    margin-bottom: 0.5rem;
}

/* ── Individual Tool Page ──────────────────────────────────────────────── */

/* Tool Hero */
.ft-tool-hero {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}

.ft-tool-hero h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
}

.ft-tool-hero .ft-tool-subtitle {
    font-size: 1.05rem;
    color: #555;
    max-width: 650px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* Tool Form */
.ft-form-container {
    max-width: 650px;
    margin: 0 auto 2rem;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.ft-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

.ft-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.4rem;
}

.ft-form-group input[type="text"],
.ft-form-group input[type="url"],
.ft-form-group input[type="number"],
.ft-form-group textarea,
.ft-form-group select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #fafafa;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.ft-form-group input:focus,
.ft-form-group textarea:focus,
.ft-form-group select:focus {
    outline: none;
    border-color: #fbc100;
    box-shadow: 0 0 0 3px rgba(251, 193, 0, 0.15);
    background: #fff;
}

.ft-form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.ft-form-group .ft-char-count {
    font-size: 0.75rem;
    color: #999;
    text-align: right;
    margin-top: 0.25rem;
}

.ft-form-row {
    display: flex;
    gap: 1rem;
}

.ft-form-row .ft-form-group {
    flex: 1;
}

.ft-generate-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    color: #000;
    background: #fbc100;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 0.5rem;
}

.ft-generate-btn:hover {
    background: #e6b000;
}

.ft-generate-btn:active {
    transform: scale(0.98);
}

.ft-generate-btn:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

.ft-generate-btn .ft-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: ft-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

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

.ft-rate-limit-info {
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.75rem;
}

/* ── Results Area ──────────────────────────────────────────────────────── */
.ft-results {
    max-width: 650px;
    margin: 0 auto 2.5rem;
    display: none;
}

.ft-results.ft-visible {
    display: block;
}

.ft-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ft-results-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.ft-result-card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
}

.ft-result-card pre,
.ft-result-card .ft-result-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.ft-result-card code {
    display: block;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-x: auto;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: #333;
    white-space: pre;
}

.ft-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #333;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.ft-copy-btn:hover {
    background: #e0e0e0;
}

.ft-copy-btn.ft-copied {
    color: #16a34a;
    background: #f0fdf4;
    border-color: #86efac;
}

/* Calculator results */
.ft-calc-result {
    text-align: center;
    padding: 1.5rem;
}

.ft-calc-result .ft-calc-rate {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.ft-calc-result .ft-calc-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.ft-calc-result .ft-calc-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ft-calc-badge.ft-excellent { background: #dcfce7; color: #166534; }
.ft-calc-badge.ft-good { background: #dbeafe; color: #1e40af; }
.ft-calc-badge.ft-average { background: #fef9c3; color: #854d0e; }
.ft-calc-badge.ft-low { background: #fee2e2; color: #991b1b; }

.ft-calc-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.ft-calc-stat {
    text-align: center;
    min-width: 80px;
}

.ft-calc-stat .ft-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
}

.ft-calc-stat .ft-stat-label {
    font-size: 0.75rem;
    color: #888;
}

/* SERP Preview */
.ft-serp-preview {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 1.25rem;
    font-family: Arial, sans-serif;
}

.ft-serp-preview .ft-serp-title {
    font-size: 1.15rem;
    color: #1a0dab;
    margin-bottom: 0.2rem;
    cursor: pointer;
    line-height: 1.3;
}

.ft-serp-preview .ft-serp-title:hover {
    text-decoration: underline;
}

.ft-serp-preview .ft-serp-url {
    font-size: 0.82rem;
    color: #006621;
    margin-bottom: 0.3rem;
    word-break: break-all;
}

.ft-serp-preview .ft-serp-desc {
    font-size: 0.85rem;
    color: #545454;
    line-height: 1.5;
}

.ft-serp-chars {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.78rem;
    color: #888;
}

.ft-serp-chars .ft-ok { color: #16a34a; }
.ft-serp-chars .ft-warn { color: #dc2626; }

/* ── CTA Banner ────────────────────────────────────────────────────────── */
.ft-cta-banner {
    background: #111;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin: 2.5rem auto;
    max-width: 650px;
}

.ft-cta-banner h3 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ft-cta-banner p {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.ft-cta-banner .ft-cta-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #000;
    background: #fbc100;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.ft-cta-banner .ft-cta-btn:hover {
    background: #e6b000;
}

.ft-cta-sub {
    font-size: 0.78rem;
    color: #666;
    margin-top: 0.5rem;
}

/* ── Content Sections (How it works, Tips, FAQ, etc.) ──────────────────── */
.ft-section {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.ft-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.25rem;
    text-align: center;
}

/* How It Works */
.ft-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.ft-step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fbc100;
    color: #000;
    font-weight: 800;
    font-size: 1rem;
    border-radius: 50%;
}

.ft-step-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.3rem;
}

.ft-step-content p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* Use Cases Grid */
.ft-use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.ft-use-case-card {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.25rem;
}

.ft-use-case-card .ft-uc-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fbc100;
    margin-bottom: 0.4rem;
}

.ft-use-case-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.4rem;
}

.ft-use-case-card p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Pro Tips */
.ft-tips-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    counter-reset: tip-counter;
}

.ft-tip {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    counter-increment: tip-counter;
}

.ft-tip-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #333;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 50%;
}

.ft-tip-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.2rem;
}

.ft-tip-content p {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    margin: 0;
}

/* FAQ Accordion */
.ft-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ft-faq-item {
    border-bottom: 1px solid #eee;
}

.ft-faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    font-family: inherit;
}

.ft-faq-question:hover {
    color: #fbc100;
}

.ft-faq-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
    color: #999;
}

.ft-faq-item.ft-open .ft-faq-arrow {
    transform: rotate(180deg);
}

.ft-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ft-faq-item.ft-open .ft-faq-answer {
    max-height: 500px;
}

.ft-faq-answer p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    padding: 0 0 1rem;
    margin: 0;
}

/* Related Tools */
.ft-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.ft-related-card {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease;
}

.ft-related-card:hover {
    border-color: #fbc100;
}

.ft-related-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.ft-related-card p {
    font-size: 0.8rem;
    color: #777;
    margin: 0;
    line-height: 1.4;
}

/* Breadcrumb */
.ft-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #888;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.ft-breadcrumb a {
    color: #888;
    text-decoration: none;
}

.ft-breadcrumb a:hover {
    color: #fbc100;
}

.ft-breadcrumb span {
    color: #bbb;
}

/* Error */
.ft-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: none;
}

.ft-error.ft-visible {
    display: block;
}

/* ── Keyword Density Results ──────────────────────────────────────────── */
.ft-density-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ft-density-table th,
.ft-density-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ft-density-table th {
    font-weight: 600;
    color: #555;
    background: #fafafa;
}

.ft-density-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.ft-density-bar-fill {
    height: 100%;
    background: #fbc100;
    border-radius: 3px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ft-page {
        padding: 1rem 1rem 3rem;
    }

    .ft-hero {
        padding: 2rem 0 1rem;
    }

    .ft-tools-grid {
        grid-template-columns: 1fr;
    }

    .ft-form-container {
        padding: 1.25rem;
    }

    .ft-form-row {
        flex-direction: column;
        gap: 0;
    }

    .ft-use-cases-grid {
        grid-template-columns: 1fr;
    }

    .ft-related-grid {
        grid-template-columns: 1fr;
    }

    .ft-calc-result .ft-calc-rate {
        font-size: 2rem;
    }

    .ft-cta-banner {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .ft-hero h1 {
        font-size: 1.6rem;
    }

    .ft-tool-hero h1 {
        font-size: 1.5rem;
    }

    .ft-form-group input,
    .ft-form-group textarea,
    .ft-form-group select {
        font-size: 1rem;
    }
}
