/* ==========================================================================
   RAWVI AI — AI Tools & GitHub Repositories Directory Styles
   Theme Tokens: --bg, --surface, --text, --muted, --accent, --gold, --navy
   ========================================================================== */

.tools-hub-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 0 4rem;
}

/* --- Reusable Breadcrumb Navigation --- */
.breadcrumb-nav {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 0 1.5rem 0 !important;
    font-size: 0.85rem !important;
    color: var(--muted) !important;
}

.breadcrumb-nav a {
    color: var(--muted) !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.breadcrumb-nav a:hover {
    color: var(--navy) !important;
    text-decoration: underline !important;
}

.breadcrumb-nav .breadcrumb-sep {
    color: #94a3b8 !important;
    user-select: none;
    padding: 0 2px;
}

.breadcrumb-nav .breadcrumb-current {
    color: var(--navy) !important;
    font-weight: 600 !important;
}

/* --- Hero Banner --- */
.tools-hero {
    padding: 3.5rem 1rem 2.5rem;
    text-align: center;
    position: relative;
}

.tools-hero .hero-inner {
    max-width: 820px;
    margin: 0 auto;
}

.tools-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 1rem;
    border: 1px solid rgba(167, 123, 45, 0.2);
}

.tools-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--navy);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.tools-hero p.subtitle {
    font-size: 1.1rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 auto 1.8rem;
    max-width: 680px;
}

/* --- Dual Tab Switcher --- */
.dual-tab-wrapper {
    display: flex;
    justify-content: center;
    margin: 0 auto 2.5rem;
}

.dual-tab-switcher {
    display: inline-flex;
    background: rgba(17, 24, 39, 0.06);
    padding: 5px;
    border-radius: 999px;
    border: 1px solid var(--border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    background: transparent;
}

.tab-btn:hover {
    color: var(--navy);
}

.tab-btn.active {
    background: var(--surface);
    color: var(--navy);
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.1);
}

.tab-badge {
    background: rgba(17, 24, 39, 0.08);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--navy);
}

.tab-btn.active .tab-badge {
    background: var(--gold-soft);
    color: var(--accent-strong);
}

/* --- Discovery Filter Toolbar --- */
.filter-toolbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.toolbar-top-row {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.search-input-wrap {
    flex: 1;
    min-width: 260px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 0.94rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-select {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--accent);
}

/* Category Pills */
.category-pills-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.category-pill {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-pill:hover {
    color: var(--navy);
    border-color: rgba(167, 123, 45, 0.4);
    background: rgba(167, 123, 45, 0.05);
}

.category-pill.active {
    background: var(--navy);
    color: #ffffff;
    border-color: var(--navy);
}

/* --- Cards Grid --- */
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 24px;
    margin-bottom: 3rem;
    width: 100%;
}

@media (max-width: 640px) {
    .directory-grid {
        grid-template-columns: 1fr;
    }
}

/* --- AI Tool Card --- */
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    box-shadow: 0 4px 18px rgba(17, 24, 39, 0.04);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(167, 123, 45, 0.35);
}

.tool-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 1rem;
}

.tool-logo-wrap {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tool-heading-info {
    flex: 1;
    min-width: 0;
}

.tool-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.tool-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.verified-icon {
    color: #0284c7;
    flex-shrink: 0;
}

.tool-badges-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.badge-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-cat {
    background: rgba(17, 24, 39, 0.06);
    color: var(--muted);
}

.badge-pricing-free {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.badge-pricing-freemium {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
}

.badge-pricing-paid {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.badge-deal {
    background: linear-gradient(135deg, rgba(217, 179, 109, 0.25), rgba(167, 123, 45, 0.18));
    color: var(--accent-strong);
    border: 1px solid rgba(167, 123, 45, 0.3);
}

.tool-tagline {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-summary {
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.45;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Feature tags */
.tool-features-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.feature-tag {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--muted);
    background: var(--surface-alt);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Tool Card Actions ("Click to Buy" + Read Review) */
.tool-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-buy {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold) 0%, #b88a38 100%);
    color: #111827;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(184, 138, 56, 0.25);
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(184, 138, 56, 0.35);
    background: linear-gradient(135deg, #f0c370 0%, #a77b2d 100%);
}

.btn-details {
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--navy);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-details:hover {
    background: rgba(17, 24, 39, 0.06);
    border-color: rgba(17, 24, 39, 0.2);
}

/* --- GitHub Repository Card --- */
.repo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 4px 18px rgba(17, 24, 39, 0.04);
}

.repo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(56, 189, 248, 0.35);
}

.repo-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.repo-octocat-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--navy);
}

.repo-stars-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(217, 179, 109, 0.15);
    color: var(--accent-strong);
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(167, 123, 45, 0.2);
}

.repo-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
    line-height: 1.35;
}

.repo-full-name {
    font-size: 0.82rem;
    color: #0284c7;
    margin-bottom: 0.75rem;
    display: block;
    word-break: break-all;
}

.repo-description {
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.repo-meta-row {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.repo-lang {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: var(--navy);
}

.lang-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38bdf8;
}

.repo-license {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.repo-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-github {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    background: var(--navy);
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-github:hover {
    background: #1e293b;
    transform: translateY(-2px);
}

/* --- Single Detail Page Styles --- */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 36px;
    margin-top: 2rem;
}

@media (max-width: 960px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

.detail-main {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.detail-sidebar {
    position: sticky;
    top: 90px;
}

.cta-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.cta-box .btn-buy {
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.cta-box .btn-secondary-link {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    background: var(--surface-alt);
    border: 1px solid var(--border);
}

.cta-box .btn-secondary-link:hover {
    color: var(--navy);
    background: rgba(17, 24, 39, 0.05);
}

.affiliate-disclaimer {
    font-size: 0.76rem;
    color: var(--muted);
    line-height: 1.45;
    background: var(--surface-alt);
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 14px;
    border: 1px solid var(--border);
}

/* Typography in Detailed Content & Markdown */
.detail-content h1, .markdown-body h1 {
    font-size: 1.6rem;
    color: var(--navy);
    margin: 1.8rem 0 0.8rem;
    font-weight: 800;
}

.detail-content h2, .markdown-body h2 {
    font-size: 1.35rem;
    color: var(--navy);
    margin: 1.6rem 0 0.8rem;
    font-weight: 700;
}

.detail-content h3, .markdown-body h3 {
    font-size: 1.15rem;
    color: var(--navy);
    margin: 1.4rem 0 0.6rem;
    font-weight: 700;
}

.detail-content h4, .markdown-body h4 {
    font-size: 1rem;
    color: var(--navy);
    margin: 1.2rem 0 0.5rem;
    font-weight: 700;
}

.detail-content p, .markdown-body p {
    color: #334155;
    line-height: 1.75;
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

.detail-content ul, .detail-content ol, .markdown-body ul, .markdown-body ol {
    margin: 0 0 1.4rem 1.5rem;
    color: #334155;
    line-height: 1.7;
}

.detail-content li, .markdown-body li {
    margin-bottom: 0.35rem;
}

.detail-content strong, .markdown-body strong {
    color: var(--navy);
    font-weight: 700;
}

.detail-content pre, .markdown-body pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.2rem;
    border-radius: 14px;
    overflow-x: auto;
    margin-bottom: 1.4rem;
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
    font-size: 0.9rem;
}

.detail-content code, .markdown-body code {
    background: rgba(17, 24, 39, 0.06);
    color: var(--navy);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.88em;
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
}

.detail-content pre code, .markdown-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.detail-content blockquote, .markdown-body blockquote {
    border-left: 4px solid var(--accent);
    padding: 0.75rem 1.25rem;
    margin: 1.2rem 0;
    background: var(--surface-alt);
    border-radius: 0 12px 12px 0;
    color: var(--muted);
    font-style: italic;
}

