/* ===== GLOBAL RESET & VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #F4F6F8;
    --card-bg: #ffffff;
    --text-main: #0A192F;
    --text-muted: #545454;
    --header-dark: #0A192F;
    --green: #00BFA6;
    --green-hover: #008f7a;
    --hero-gradient: linear-gradient(135deg, #0A192F 0%, #00BFA6 60%, #38EF7D 100%);
    --ad-bg: rgba(0, 0, 0, 0.03);
    --border: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --bg: #050d1a;
    --card-bg: #112240;
    --text-main: #ffffff;
    --text-muted: #bdc1c6;
    --ad-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    transition: background 0.3s ease;
}

/* ===== HEADER & NAVIGATION ===== */
header {
    background: var(--header-dark);
    padding: 15px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .logo {
    max-height: 45px;
}

.header-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 8px 15px;
    transition: 0.3s;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--green);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 2px;
}

.dark-mode-toggle {
    background: var(--green);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    margin-left: 10px;
}

/* ===== HERO SECTION ===== */
.seo-hero {
    background: var(--hero-gradient);
    color: white;
    text-align: center;
    padding: 70px 20px;
}

.seo-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.seo-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== MAIN CONTAINER & AD SLOTS ===== */
.seo-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.sponsor-slot {
    width: 100%;
    background: var(--ad-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    margin: 10px 0;
}

.sponsor-slot span {
    font-size: 0.65rem;
    color: #888;
    letter-spacing: 2px;
    font-weight: 700;
}

.top-ad {
    min-height: 90px;
}

.feed-ad {
    min-height: 250px;
}

.content-ad {
    min-height: 280px;
}

/* ===== TOOL CARD & INPUTS ===== */
.tool-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.tool-card h2 {
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.tool-textarea {
    width: 100%;
    height: 200px;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border);
    font-family: 'Courier New', monospace;
    margin-bottom: 25px;
    background: #fafafa;
    color: #333;
    resize: vertical;
    transition: 0.3s;
}

body.dark-mode .tool-textarea {
    background: #0d192e;
    color: #fff;
    border-color: #233554;
}

.tool-btn-main {
    background: var(--green);
    color: white;
    border: none;
    padding: 18px 45px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    transition: 0.3s;
    text-transform: uppercase;
}

.tool-btn-main:hover {
    background: var(--green-hover);
    transform: translateY(-2px);
}

/* ===== RESULTS & SERP SECTION ===== */
.results-container {
    margin-top: 40px;
    text-align: left;
    border-top: 2px solid var(--green);
    padding-top: 30px;
}

.results-title {
    margin-bottom: 20px;
    color: var(--green);
}

.serp-section {
    background: #fff;
    border: 1px solid #ddd;
    padding: 25px;
    border-radius: 12px;
    margin: 25px 0;
    position: relative;
}

body.dark-mode .serp-section {
    background: #0a192f;
    border-color: #233554;
}

.copy-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-main);
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 25px 0;
}

.data-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.data-item strong {
    display: block;
    font-size: 0.8rem;
    color: var(--green);
    text-transform: uppercase;
}

/* Tree View Styling */
.outline-list {
    list-style: none;
    padding: 0;
}

.outline-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border);
}

body.dark-mode .outline-item {
    background: rgba(255, 255, 255, 0.03);
}

.tag-label {
    background: var(--green);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 11px;
    margin-right: 12px;
    min-width: 38px;
    text-align: center;
}

/* Indentation logic matching your logic */
.indent-2 {
    margin-left: 20px;
    border-left: 2px solid var(--green);
}

.indent-3 {
    margin-left: 40px;
    border-left: 2px solid var(--green);
}

.indent-4 {
    margin-left: 60px;
    border-left: 2px solid var(--green);
}

/* Recommendations */
.rec-list {
    list-style: none;
    padding: 0;
}

.rec-list li {
    padding: 10px;
    background: rgba(0, 0, 0, 0.02);
    margin-bottom: 8px;
    border-left: 4px solid var(--green);
    border-radius: 4px;
    font-size: 0.95rem;
}

body.dark-mode .rec-list li {
    background: rgba(255, 255, 255, 0.05);
}

.tool-btn-secondary {
    background: transparent;
    color: var(--green);
    border: 2px solid var(--green);
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: 0.3s;
}

.tool-btn-secondary:hover {
    background: var(--green);
    color: white;
}

/* ===== INFO CARDS & TRUST GRID ===== */
.info-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.info-card h2 {
    margin-bottom: 25px;
    color: var(--green);
    font-weight: 800;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.trust-card {
    background: rgba(0, 0, 0, 0.02);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border);
}

body.dark-mode .trust-card {
    background: rgba(255, 255, 255, 0.03);
}

.trust-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--green);
}

.trust-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* FAQ Section */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}

.faq-item strong {
    color: var(--green);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 8px;
}

.faq-item p {
    color: var(--text-muted);
}

/* Tag Cloud (Related Tools) */
.tag-cloud {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.tag-cloud a {
    text-decoration: none;
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: 0.3s;
}

.tag-cloud a:hover {
    background: var(--green);
    transform: translateY(-3px);
}

/* ===== FOOTER ===== */
footer {
    background: var(--header-dark);
    color: white;
    text-align: center;
    padding: 60px 20px;
    margin-top: 80px;
}

.footer-note {
    font-size: 0.85rem;
    opacity: 0.6;
    margin: 15px auto;
    max-width: 500px;
}

.footer-links {
    margin-top: 20px;
}

footer a,
footer a:visited {
    color: var(--green) !important;
    text-decoration: none;
    margin: 0 10px;
    transition: 0.3s;
}

footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .header-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--header-dark);
        padding: 20px;
        border-top: 1px solid var(--border);
        gap: 15px;
        text-align: center;
        z-index: 999;
    }

    .header-nav.active {
        display: flex;
    }

    .seo-hero h1 {
        font-size: 2rem;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }

    .trust-grid {
        grid-template-columns: 1fr;
    }

    .tool-card {
        padding: 25px;
    }
}

/* ===== RELATED TOOLS / TAG CLOUD STYLING ===== */
.info-card.related-tools {
    text-align: center;
}

.tag-cloud {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    /* Centers the links */
    margin-top: 20px;
}

.tag-cloud a {
    text-decoration: none;
    background: #333;
    /* Dark background like your other tools */
    color: white;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: 0.3s ease;
    border: 1px solid transparent;
}

.tag-cloud a:hover {
    background: var(--green);
    /* Turns green on hover */
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 191, 166, 0.3);
}

/* Dark Mode Adjustment */
body.dark-mode .tag-cloud a {
    background: #1d2d44;
    border-color: var(--border);
}

body.dark-mode .tag-cloud a:hover {
    background: var(--green);
}

/* Styling for code snippets within text */
code {
    background: rgba(0, 191, 166, 0.1);
    color: var(--green);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

body.dark-mode code {
    background: rgba(255, 255, 255, 0.1);
    color: #38EF7D;
}

/* User Guide / FAQ Item Spacing */
.faq-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

/* Tree View Indentation (For the Results Section) */
.outline-list {
    list-style: none;
    padding: 10px 0;
}

.outline-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: 0.3s;
}

.outline-item:hover {
    border-color: var(--green);
    transform: translateX(5px);
}

.tag-label {
    background: var(--green);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 11px;
    margin-right: 15px;
    min-width: 45px;
    text-align: center;
    text-transform: uppercase;
}

/* Nested Visual Cues */
.indent-2 {
    margin-left: 25px;
    border-left: 3px solid var(--green);
}

.indent-3 {
    margin-left: 50px;
    border-left: 3px solid #38EF7D;
}

.indent-4 {
    margin-left: 75px;
    border-left: 3px solid #008f7a;

}

/* Add remaining indentation levels for completeness */
.indent-5 {
    margin-left: 100px;
    border-left: 3px solid #545454;
}

.indent-6 {
    margin-left: 125px;
    border-left: 3px solid #888;
}

/* Make the 'Empty Heading' warning stand out */
.tag-text span {
    font-style: italic;
    font-weight: 700;
}

/* Result highlight animation */
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.outline-item {
    animation: fadeInSlide 0.3s ease-out forwards;
}
