/* ============================================================
   ToolsHub — Public Design System (Stage 10.6)
   ============================================================ */

:root {
    /* Category Accent Colors */
    --cat-seo: #2563EB;      /* Blue */
    --cat-pdf: #DC2626;      /* Red */
    --cat-business: #0D9488; /* Teal */
    --cat-dev: #EA580C;      /* Orange */
    --cat-image: #7C3AED;    /* Violet */
    --cat-calc: #059669;     /* Green */
    --cat-text: #8B5CF6;     /* Purple */
    --cat-security: #475569; /* Slate */
    --cat-default: #64748B;

    --sidebar-width: 260px;
    --topbar-height: 70px;
}

/* --- Layout Shell --- */
body.public-body {
    background-color: var(--bg-main);
    margin: 0;
    padding: 0;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.sidebar-nav {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-group {
    margin-top: 24px;
}

.sidebar-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* Category Icon Colors */
.cat-icon-seo { color: var(--cat-seo); }
.cat-icon-pdf { color: var(--cat-pdf); }
.cat-icon-dev { color: var(--cat-dev); }
.cat-icon-image { color: var(--cat-image); }
.cat-icon-calc { color: var(--cat-calc); }
.cat-icon-text { color: var(--cat-text); }
.cat-icon-security { color: var(--cat-security); }

/* Sidebar Footer (Stats) */
.sidebar-footer {
    margin-top: auto;
    padding: 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
}

.sidebar-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar-stat {
    text-align: center;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.sidebar-stat strong {
    display: block;
    font-size: 1.25rem;
    color: var(--text-main);
    line-height: 1.2;
}

.sidebar-stat span {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

/* --- Main Content Area --- */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex blowout */
}

/* --- Topbar --- */
.app-topbar {
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.topbar-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.topbar-link:hover {
    color: var(--primary);
}

.topbar-search {
    position: relative;
    width: 240px;
}

.topbar-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    background: var(--bg-main);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

.topbar-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-light);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-main);
}

/* --- Main Content Container --- */
.app-content {
    padding: 32px;
    flex: 1;
}

.app-content .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0; /* Override default padding since .app-content has it */
}

/* --- Footer --- */
.app-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 48px 32px 24px;
    margin-top: 64px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto 32px;
}

.footer-brand h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 280px;
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col a {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* --- Responsive Layout --- */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    
    .app-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
    }

    .app-main {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .topbar-search {
        width: 200px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .app-topbar {
        padding: 0 16px;
    }
    
    .topbar-nav {
        display: none; /* Hide links on very small screens, or use a mobile menu */
    }

    .topbar-search {
        width: 160px;
    }

    .app-content {
        padding: 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
/* ============================================================
   Stage 10.6, Phase C — Homepage Hero & Sections
   ============================================================ */

/* --- Hero Section --- */
.home-hero {
    background: radial-gradient(circle at 50% -20%, var(--primary-light) 0%, transparent 60%), var(--bg-main);
    padding: 60px 24px 40px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    background: var(--surface);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.hero-heading {
    font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin-bottom: 16px;
}

.hero-subheading {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 600px;
    margin-inline: auto;
}

.hero-search {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 6px 6px 16px;
    max-width: 580px;
    margin: 0 auto 32px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.hero-search svg {
    width: 20px;
    height: 20px;
    color: var(--text-light);
}

.hero-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 1rem;
    outline: none;
}

.hero-search button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 10px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.hero-search button:hover {
    background: var(--primary-hover);
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* --- Category Pills --- */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto 48px;
    padding: 0 16px;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.cat-pill:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cat-pill svg {
    width: 16px;
    height: 16px;
}

/* --- Category Tool Sections --- */
.home-sections {
    display: flex;
    flex-direction: column;
    gap: 56px;
    margin-bottom: 64px;
}

.home-cat-section {
    display: flex;
    flex-direction: column;
}

.cat-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}

.cat-title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cat-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-main);
}

.cat-icon-box svg {
    width: 24px;
    height: 24px;
}

.cat-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px;
}

.cat-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.cat-view-all {
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.cat-view-all:hover {
    text-decoration: underline;
}

/* --- Premium Tool Cards --- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.premium-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.premium-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.tool-card-top {
    margin-bottom: 16px;
}

.tool-icon-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-main);
}

.tool-icon-small svg {
    width: 18px;
    height: 18px;
}

.tool-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 8px;
    line-height: 1.3;
}

.tool-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 20px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-card-action {
    margin-top: auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

/* --- Color Classes for Categories --- */
.cat-icon-seo { color: var(--cat-seo); background: #eff6ff; }
.cat-icon-pdf { color: var(--cat-pdf); background: #fef2f2; }
.cat-icon-dev { color: var(--cat-dev); background: #fff7ed; }
.cat-icon-image { color: var(--cat-image); background: #f5f3ff; }
.cat-icon-calc { color: var(--cat-calc); background: #ecfdf5; }
.cat-icon-text { color: var(--cat-text); background: #faf5ff; }
.cat-icon-security { color: var(--cat-security); background: #f8fafc; }

/* View All Link Colors */
.cat-view-all.cat-icon-seo { color: var(--cat-seo); background: none; }
.cat-view-all.cat-icon-pdf { color: var(--cat-pdf); background: none; }
.cat-view-all.cat-icon-dev { color: var(--cat-dev); background: none; }
.cat-view-all.cat-icon-image { color: var(--cat-image); background: none; }
.cat-view-all.cat-icon-calc { color: var(--cat-calc); background: none; }
.cat-view-all.cat-icon-text { color: var(--cat-text); background: none; }
.cat-view-all.cat-icon-security { color: var(--cat-security); background: none; }

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .home-hero {
        padding: 40px 16px 32px;
    }
    
    .hero-search {
        flex-direction: column;
        border-radius: 12px;
        padding: 12px;
        background: transparent;
        box-shadow: none;
        border: none;
        gap: 12px;
    }

    .hero-search svg {
        display: none;
    }

    .hero-search input {
        width: 100%;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: var(--shadow-sm);
    }

    .hero-search button {
        width: 100%;
        border-radius: 8px;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .cat-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .cat-view-all {
        align-self: flex-start;
        margin-top: 8px;
    }
}
/* ============================================================
   Stage 10.6, Phase D — All Tools Page
   ============================================================ */

.page-top-hero {
    background: var(--bg-main);
    padding: 48px 0 32px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.section-block {
    padding: 48px 0;
    border-bottom: 1px solid var(--border);
}

.section-head {
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.02em;
}

/* Adjust top margin for the category sections wrapper */
.container .home-sections {
    margin-top: 48px;
}