/* ============================================================
   GoSEOBuzz Tools Engine – Main Stylesheet
   ============================================================ */

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
    --goseo-primary:    #0f6fff;
    --goseo-primary-dk: #0050c9;
    --goseo-accent:     #ff6b35;
    --goseo-bg:         #f4f7fc;
    --goseo-surface:    #ffffff;
    --goseo-border:     #e2e8f0;
    --goseo-text:       #1a202c;
    --goseo-muted:      #718096;
    --goseo-success:    #22c55e;
    --goseo-warning:    #f59e0b;
    --goseo-error:      #ef4444;
    --goseo-radius:     12px;
    --goseo-shadow:     0 4px 24px rgba(0,0,0,.08);
    --goseo-shadow-hover: 0 8px 32px rgba(15,111,255,.14);
    --goseo-font:       'Inter', 'Segoe UI', system-ui, sans-serif;
    --goseo-mono:       'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* ─── Tool Wrapper ───────────────────────────────────────── */
.goseo-tool-wrapper {
    font-family: var(--goseo-font);
    color: var(--goseo-text);
    max-width: 1200px;
    margin: 0 auto;
}

/* ─── Hero ────────────────────────────────────────────────── */
.goseo-tool-hero {
    background: linear-gradient(135deg, var(--goseo-primary) 0%, #1a4fd8 50%, var(--goseo-accent) 100%);
    border-radius: var(--goseo-radius);
    padding: 3rem 2.5rem;
    margin-bottom: 2rem;
    color: #fff;
}
.goseo-tool-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 1rem;
    color: #fff;
}
.goseo-tool-intro {
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 0;
    opacity: .92;
    color: #fff;
}

/* ─── Tool Interface ──────────────────────────────────────── */
.goseo-tool-interface {
    background: var(--goseo-surface);
    border-radius: var(--goseo-radius);
    padding: 2rem;
    box-shadow: var(--goseo-shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--goseo-border);
}
.goseo-tool-label {
    display: block;
    font-weight: 600;
    margin-bottom: .5rem;
    color: var(--goseo-text);
    font-size: .95rem;
}
.goseo-tool-input,
.goseo-tool-textarea {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid var(--goseo-border);
    border-radius: 8px;
    font-family: var(--goseo-font);
    font-size: .95rem;
    color: var(--goseo-text);
    background: var(--goseo-bg);
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.goseo-tool-textarea { resize: vertical; min-height: 120px; }
.goseo-tool-input:focus,
.goseo-tool-textarea:focus {
    outline: none;
    border-color: var(--goseo-primary);
    box-shadow: 0 0 0 3px rgba(15,111,255,.15);
    background: #fff;
}
.goseo-tool-input--lg { font-size: 1.1rem; padding: 1rem 1.25rem; }
.goseo-mono { font-family: var(--goseo-mono) !important; font-size: .875rem; }
.goseo-output-code { background: #0d1117; color: #e6edf3; }

/* ─── Form ────────────────────────────────────────────────── */
.goseo-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.goseo-form-group { display: flex; flex-direction: column; gap: .4rem; }
.goseo-form-group label { font-weight: 600; font-size: .9rem; }
.goseo-form-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.goseo-char-hint { color: var(--goseo-muted); font-weight: 400; margin-left: .5rem; font-size: .85rem; }
.goseo-radio-group { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.goseo-radio-group label { font-weight: 400; cursor: pointer; }

/* ─── Two Column ──────────────────────────────────────────── */
.goseo-tool-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .goseo-tool-two-col { grid-template-columns: 1fr; } }
.goseo-tool-col { display: flex; flex-direction: column; gap: .5rem; }

/* ─── Stats Grid ──────────────────────────────────────────── */
.goseo-tool-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.goseo-stat-box {
    background: var(--goseo-bg);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--goseo-border);
    transition: transform .2s, box-shadow .2s;
}
.goseo-stat-box:hover { transform: translateY(-2px); box-shadow: var(--goseo-shadow); }
.goseo-stat-num { display: block; font-size: 2rem; font-weight: 800; color: var(--goseo-primary); }
.goseo-stat-label { font-size: .8rem; color: var(--goseo-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* ─── Actions (Button Row) ────────────────────────────────── */
.goseo-tool-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.goseo-case-buttons { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

/* ─── Output ──────────────────────────────────────────────── */
.goseo-tool-output {
    background: var(--goseo-bg);
    border: 1px solid var(--goseo-border);
    border-radius: var(--goseo-radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}
.goseo-output-meta { color: var(--goseo-muted); font-size: .9rem; margin-bottom: .75rem; }
.goseo-output-summary { margin-bottom: 1rem; font-weight: 600; }
.goseo-tool-error { background: #fef2f2; border: 1px solid #fca5a5; color: var(--goseo-error); border-radius: 8px; padding: .75rem 1rem; margin-top: 1rem; font-size: .9rem; }
.goseo-tool-status { background: #f0fdf4; border: 1px solid #86efac; color: #166534; border-radius: 8px; padding: .75rem 1rem; margin-top: 1rem; font-size: .9rem; }
.goseo-tool-advice { border-radius: 8px; padding: .75rem 1rem; font-size: .9rem; }

/* ─── Output Table ────────────────────────────────────────── */
.goseo-output-table { width: 100%; border-collapse: collapse; margin-top: .75rem; }
.goseo-output-table th { background: var(--goseo-primary); color: #fff; padding: .6rem 1rem; text-align: left; font-size: .85rem; }
.goseo-output-table td { padding: .55rem 1rem; border-bottom: 1px solid var(--goseo-border); font-size: .9rem; }
.goseo-output-table tr:hover td { background: #f8fafc; }

/* ─── SERP Preview Box ────────────────────────────────────── */
.goseo-serp-preview-box {
    background: #fff;
    border: 1px solid var(--goseo-border);
    border-radius: var(--goseo-radius);
    padding: 2rem;
    margin-top: 1.5rem;
    font-family: Arial, sans-serif;
}
.goseo-serp-result { max-width: 600px; }
.goseo-serp-url { font-size: .875rem; color: #202124; margin-bottom: .2rem; }
.goseo-serp-title { font-size: 1.25rem; color: #1a0dab; font-weight: 400; margin-bottom: .2rem; cursor: pointer; }
.goseo-serp-title:hover { text-decoration: underline; }
.goseo-serp-desc { font-size: .875rem; color: #4d5156; line-height: 1.5; }
.goseo-serp-warnings { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.goseo-serp-warn { padding: .5rem .75rem; border-radius: 6px; font-size: .85rem; }
.goseo-serp-warn.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.goseo-serp-warn.ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ─── Title Meter ─────────────────────────────────────────── */
.goseo-title-meter-wrap { margin-top: 1rem; }
.goseo-title-meter {
    position: relative;
    height: 14px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.goseo-title-meter-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--goseo-success), var(--goseo-warning) 65%, var(--goseo-error));
    border-radius: 99px;
    width: 0%;
    transition: width .3s;
}
.goseo-title-meter-limit {
    position: absolute;
    top: -2px; bottom: -2px;
    width: 3px;
    background: rgba(0,0,0,.4);
}
.goseo-title-meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    color: var(--goseo-muted);
    margin-top: .25rem;
}

/* ─── Slug Preview ────────────────────────────────────────── */
.goseo-slug-preview {
    background: var(--goseo-bg);
    border: 1.5px solid var(--goseo-border);
    border-radius: 8px;
    padding: .75rem 1rem;
    font-family: var(--goseo-mono);
    font-size: .95rem;
}
.goseo-slug-domain { color: var(--goseo-muted); }
.goseo-slug-part { color: var(--goseo-primary); font-weight: 600; }
.goseo-cat-badge { display: inline-block; padding: .2rem .6rem; height: auto; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--goseo-bg); color: var(--goseo-primary); border: 1px solid var(--goseo-border); }

/* ─── Alt Text Suggestions ────────────────────────────────── */
.goseo-alt-suggestions { display: flex; flex-direction: column; gap: .75rem; margin-top: .5rem; }
.goseo-alt-suggestion-item {
    background: var(--goseo-bg);
    border: 1.5px solid var(--goseo-border);
    border-radius: 8px;
    padding: .75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.goseo-alt-suggestion-item span { flex: 1; font-size: .95rem; }
.goseo-alt-suggestion-item button {
    background: var(--goseo-primary);
    color: #fff;
    border: none;
    padding: .35rem .9rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .8rem;
    white-space: nowrap;
}

/* ─── WebP Converter ──────────────────────────────────────── */
.goseo-drop-zone {
    border: 2.5px dashed var(--goseo-border);
    border-radius: var(--goseo-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.goseo-drop-zone:hover, .goseo-drop-zone.drag-over { border-color: var(--goseo-primary); background: rgba(15,111,255,.04); }
.goseo-drop-icon { font-size: 3rem; margin-bottom: 1rem; }
.goseo-drop-label { color: var(--goseo-primary); font-weight: 600; cursor: pointer; text-decoration: underline; }
.goseo-drop-hint { font-size: .85rem; color: var(--goseo-muted); margin: 0; }
.goseo-webp-list { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.5rem; }
.goseo-webp-item {
    background: var(--goseo-bg);
    border: 1px solid var(--goseo-border);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.goseo-webp-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.goseo-webp-meta { flex: 1; font-size: .875rem; }
.goseo-webp-meta strong { display: block; margin-bottom: .25rem; }

/* ─── Hashtag Cloud ──────────────────────────────────────── */
.goseo-hashtag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.goseo-hashtag-tag {
    background: linear-gradient(135deg, var(--goseo-primary), #4f8dff);
    color: #fff;
    padding: .35rem .9rem;
    border-radius: 99px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.goseo-hashtag-tag:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(15,111,255,.3); }

/* ─── Section Headers ─────────────────────────────────────── */
.goseo-section-header { text-align: center; margin-bottom: 2.5rem; }
.goseo-section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin: 0 0 .75rem; }
.goseo-section-subtitle { color: var(--goseo-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* ─── Tool Cards Grid ─────────────────────────────────────── */
.goseo-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.goseo-tools-grid--related { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.goseo-tool-card {
    background: var(--goseo-surface);
    border: 1px solid var(--goseo-border);
    border-radius: var(--goseo-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .22s, box-shadow .22s;
}
.goseo-tool-card:hover { transform: translateY(-4px); box-shadow: var(--goseo-shadow-hover); }
.goseo-tool-card__header { padding: .75rem 1.25rem; background: linear-gradient(135deg, #f8faff, #eef2ff); border-bottom: 1px solid var(--goseo-border); }
.goseo-tool-card__body { padding: 1.25rem; flex: 1; }
.goseo-tool-card__title { font-size: 1.05rem; font-weight: 700; margin: 0 0 .5rem; }
.goseo-tool-card__title a { color: var(--goseo-text); text-decoration: none; }
.goseo-tool-card__title a:hover { color: var(--goseo-primary); }
.goseo-tool-card__desc { font-size: .875rem; color: var(--goseo-muted); margin: 0; line-height: 1.6; }
.goseo-tool-card__footer { padding: 1rem 1.25rem; border-top: 1px solid var(--goseo-border); }

/* ─── Category Group (All Tools Page) ────────────────────── */
.goseo-category-group { margin-bottom: 3rem; }
.goseo-category-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 1.25rem; padding-bottom: .75rem; border-bottom: 2px solid var(--goseo-border); display: flex; align-items: center; gap: .5rem; }
.goseo-category-title::before { content: ''; display: inline-block; width: 4px; height: 1.2em; background: var(--goseo-primary); border-radius: 2px; }

/* ─── Homepage CTA ────────────────────────────────────────── */
.goseo-tools-home-cta { text-align: center; padding: 2rem; }

/* ─── All Tools Hero ──────────────────────────────────────── */
.goseo-all-tools-hero { text-align: center; padding: 3rem 1rem; margin-bottom: 2.5rem; }
.goseo-hero-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; margin: 0 0 1rem; }
.goseo-hero-desc { font-size: 1.1rem; color: var(--goseo-muted); max-width: 640px; margin: 0 auto; }

/* ─── SEO Content Section ─────────────────────────────────── */
.goseo-tool-content {
    background: var(--goseo-surface);
    border: 1px solid var(--goseo-border);
    border-radius: var(--goseo-radius);
    padding: 2.5rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}
.goseo-tool-content h2 { font-size: 1.5rem; font-weight: 800; margin-top: 0; margin-bottom: 1rem; color: var(--goseo-text); }
.goseo-tool-content h3 { font-size: 1.15rem; font-weight: 700; margin-top: 2rem; margin-bottom: .75rem; }
.goseo-tool-content p { margin: 0 0 1rem; color: #374151; }
.goseo-tool-content code { background: var(--goseo-bg); border: 1px solid var(--goseo-border); border-radius: 4px; padding: .1rem .4rem; font-family: var(--goseo-mono); font-size: .875em; }

/* ─── FAQ Section ─────────────────────────────────────────── */
.goseo-faq-section {
    background: var(--goseo-surface);
    border: 1px solid var(--goseo-border);
    border-radius: var(--goseo-radius);
    padding: 2.5rem;
    margin-bottom: 2rem;
}
.goseo-faq-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 1.5rem; }
.goseo-faq-list { display: flex; flex-direction: column; gap: .75rem; }
.goseo-faq-item { border: 1px solid var(--goseo-border); border-radius: 10px; overflow: hidden; }
.goseo-faq-question {
    width: 100%;
    background: var(--goseo-bg);
    border: none;
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: background .2s;
    font-family: var(--goseo-font);
    color: var(--goseo-text);
}
.goseo-faq-question:hover { background: #edf2ff; }
.goseo-faq-question[aria-expanded="true"] { background: #edf2ff; }
.goseo-faq-icon { font-size: 1.25rem; color: var(--goseo-primary); transition: transform .25s; flex-shrink: 0; }
.goseo-faq-question[aria-expanded="true"] .goseo-faq-icon { transform: rotate(45deg); }
.goseo-faq-answer { padding: 1rem 1.25rem; border-top: 1px solid var(--goseo-border); background: #fff; }
.goseo-faq-answer p { margin: 0; color: #4b5563; line-height: 1.7; }

/* ─── Related Tools ───────────────────────────────────────── */
.goseo-related-section { margin-bottom: 2rem; }
.goseo-related-section .goseo-section-title { font-size: 1.35rem; margin: 0 0 1.25rem; padding-bottom: .75rem; border-bottom: 2px solid var(--goseo-border); }

/* ─── Admin Panel ─────────────────────────────────────────── */
.goseo-admin-wrap { max-width: 1100px; }
.goseo-admin-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1.5rem 0; }
.goseo-admin-stat { background: #fff; border: 1px solid #ddd; border-radius: 10px; padding: 1.25rem 2rem; text-align: center; }
.goseo-admin-stat strong { display: block; font-size: 2rem; color: var(--goseo-primary); }
.goseo-admin-stat span { font-size: .85rem; color: #666; }
.goseo-admin-table { border-collapse: collapse; }
.goseo-admin-table th { background: #f1f5f9; }
.goseo-admin-table td, .goseo-admin-table th { padding: .6rem 1rem; border: 1px solid #e2e8f0; }
.goseo-admin-table code { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px; padding: .15rem .4rem; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .goseo-tool-hero { padding: 2rem 1.25rem; }
    .goseo-tool-interface { padding: 1.25rem; }
    .goseo-tool-content, .goseo-faq-section { padding: 1.5rem 1.25rem; }
    .goseo-tools-grid { grid-template-columns: 1fr 1fr; }
    .goseo-tool-actions { gap: .5rem; }
    .goseo-tool-stats-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 420px) {
    .goseo-tools-grid { grid-template-columns: 1fr; }
    .goseo-tool-stats-grid { grid-template-columns: 1fr 1fr; }
}
