/* ============================================
   GoForTool - Multi-Utility Tool Website
   Modern, Responsive, Accessible CSS
   ============================================ */

/* ============================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */

:root {
    /* Colors - Light Theme */
    --color-bg: #fafbfc;
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-border: #e5e7eb;
    --color-border-subtle: #f1f3f5;
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    
    /* Accent Colors */
    --color-accent: #6366f1;
    --color-accent-hover: #4f46e5;
    --color-accent-subtle: rgba(99, 102, 241, 0.08);
    --color-accent-glow: rgba(99, 102, 241, 0.25);
    
    /* Category Colors */
    --color-ai: #8b5cf6;
    --color-finance: #10b981;
    --color-social: #f59e0b;
    --color-dev: #3b82f6;
    
    /* Semantic Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px var(--color-accent-glow);
    
    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Spacing Scale (8pt grid) */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;
    
    /* Typography */
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
    --z-toast: 700;
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 72px;
    --mobile-nav-height: 64px;
    --content-max-width: 1400px;
}

/* Dark Theme */
[data-theme="dark"] {
    --color-bg: #0a0a0f;
    --color-surface: #12121a;
    --color-surface-elevated: #1a1a24;
    --color-border: #2a2a3a;
    --color-border-subtle: #1f1f2a;
    --color-text-primary: #f8fafc;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #71717a;
    
    --color-accent: #818cf8;
    --color-accent-hover: #a5b4fc;
    --color-accent-subtle: rgba(129, 140, 248, 0.12);
    --color-accent-glow: rgba(129, 140, 248, 0.3);
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* ============================================
   2. CSS RESET & BASE STYLES
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.scroll-locked {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   3. UTILITY CLASSES
   ============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: var(--z-toast);
    padding: var(--space-3) var(--space-4);
    background: var(--color-accent);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
    
    .desktop-only {
        display: none !important;
    }
}

/* ============================================
   4. BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-weight: 500;
    font-size: var(--text-sm);
    line-height: 1;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

/* ============================================
   5. HEADER
   ============================================ */

.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    height: var(--header-height);
    padding: 0 var(--space-6);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
    background: linear-gradient(135deg, var(--color-accent) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: var(--space-4);
    color: var(--color-text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-12) 0 var(--space-10);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

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

.search-kbd {
    position: absolute;
    right: var(--space-3);
    padding: var(--space-1) var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.search-results {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
}

.search-results[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover,
.search-result-item[aria-selected="true"] {
    background: var(--color-accent-subtle);
}

.search-result-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    color: var(--color-accent);
}

.search-result-text {
    flex: 1;
}

.search-result-title {
    font-weight: 500;
    font-size: var(--text-sm);
}

.search-result-category {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

#theme-toggle .theme-icon-dark,
[data-theme="dark"] #theme-toggle .theme-icon-light {
    display: none;
}

[data-theme="dark"] #theme-toggle .theme-icon-dark {
    display: block;
}

#mobile-menu-toggle .close-icon {
    display: none;
}

#mobile-menu-toggle[aria-expanded="true"] .menu-icon {
    display: none;
}

#mobile-menu-toggle[aria-expanded="true"] .close-icon {
    display: block;
}

.ad-header {
    padding: var(--space-3) var(--space-6);
    background: var(--color-bg);
}

/* ============================================
   6. MOBILE NAVIGATION
   ============================================ */

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.mobile-nav[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.mobile-nav-drawer {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--color-surface);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
}

.mobile-nav[aria-hidden="false"] .mobile-nav-drawer {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-title {
    font-weight: 600;
    font-size: var(--text-lg);
}

.mobile-nav-search {
    padding: var(--space-4) var(--space-5);
}

.mobile-nav-search .search-input {
    height: 44px;
}

.mobile-nav-list {
    padding: var(--space-2) 0;
}

.mobile-nav-category-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.mobile-nav-category-btn:hover {
    background: var(--color-accent-subtle);
}

.mobile-nav-category-btn .chevron {
    margin-left: auto;
    transition: transform var(--transition-fast);
}

.mobile-nav-category-btn[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.mobile-nav-submenu {
    display: none;
    padding: var(--space-2) 0;
    background: var(--color-bg);
}

.mobile-nav-submenu[aria-hidden="false"] {
    display: block;
}

.mobile-nav-submenu a {
    display: block;
    padding: var(--space-3) var(--space-5) var(--space-3) var(--space-12);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.mobile-nav-submenu a:hover {
    color: var(--color-accent);
    background: var(--color-accent-subtle);
}

/* ============================================
   7. LAYOUT
   ============================================ */

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: calc(100vh - var(--header-height));
}

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

/* ============================================
   8. SIDEBAR (Desktop)
   ============================================ */

.sidebar {
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--color-border);
    background: var(--color-surface);
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4);
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.sidebar-btn:hover {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.sidebar-btn.active {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.sidebar-btn svg {
    flex-shrink: 0;
}

.sidebar-badge {
    margin-left: auto;
    padding: var(--space-1) var(--space-2);
    background: var(--color-bg);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
}

.sidebar-divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-4) 0;
}

.sidebar-section {
    padding: 0 var(--space-4);
}

.sidebar-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sidebar-link {
    display: block;
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.sidebar-link:hover {
    color: var(--color-accent);
}

.ad-sidebar {
    padding: var(--space-4);
    border-top: 1px solid var(--color-border);
}

/* ============================================
   9. MAIN CONTENT
   ============================================ */

.main-content {
    padding: var(--space-8);
    padding-bottom: calc(var(--space-16) + var(--mobile-nav-height));
}

@media (max-width: 768px) {
    .main-content {
        padding: var(--space-4);
        padding-bottom: calc(var(--space-16) + var(--mobile-nav-height) + 60px);
    }
}

/* ============================================
   10. HERO SECTION - COMPACT VERSION
   ============================================ */

.hero-compact {
    padding: var(--space-6) var(--space-6);
    margin-bottom: var(--space-6);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--color-accent-subtle) 0%, rgba(139, 92, 246, 0.06) 100%);
    border: 1px solid var(--color-border);
}

@media (max-width: 768px) {
    .hero-compact {
        padding: var(--space-5) var(--space-4);
        margin-bottom: var(--space-5);
        border-radius: var(--radius-lg);
    }
}

.hero-compact-content {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.hero-compact-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
}

@media (max-width: 768px) {
    .hero-compact-title {
        font-size: var(--text-xl);
    }
}

@media (min-width: 1024px) {
    .hero-compact-title {
        font-size: var(--text-3xl);
    }
}

.hero-highlight {
    color: var(--color-accent);
    position: relative;
}

.hero-compact-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-4);
}

@media (max-width: 768px) {
    .hero-compact-subtitle {
        font-size: var(--text-sm);
    }
}

.hero-compact-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.hero-badge svg {
    color: var(--color-accent);
    flex-shrink: 0;
}

.hero-badge:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-subtle);
}

@media (max-width: 480px) {
    .hero-compact-badges {
        gap: var(--space-2);
    }
    
    .hero-badge {
        padding: var(--space-1) var(--space-2);
        font-size: 10px;
    }
    
    .hero-badge svg {
        width: 12px;
        height: 12px;
    }
}

/* ============================================
   11. FILTER BAR
   ============================================ */

.filter-bar {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
}

.filter-pill:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.filter-pill.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

/* ============================================
   12. TOOL CATEGORIES & GRID
   ============================================ */

.tool-category {
    margin-bottom: var(--space-10);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.category-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xl);
    font-weight: 600;
}

.category-title svg {
    color: var(--color-accent);
}

.category-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-accent);
    transition: opacity var(--transition-fast);
}

.category-link:hover {
    opacity: 0.8;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

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

/* ============================================
   13. TOOL CARDS
   ============================================ */

.tool-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    overflow: hidden;
}

.tool-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--color-accent-subtle);
    transform: translateY(-2px);
}

.tool-card-link {
    display: flex;
    flex-direction: column;
    padding: var(--space-5);
    height: 100%;
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-subtle);
    border-radius: var(--radius-md);
    color: var(--color-accent);
    margin-bottom: var(--space-4);
    transition: all var(--transition-base);
}

.tool-card:hover .tool-card-icon {
    background: var(--color-accent);
    color: white;
    transform: scale(1.05);
}

.tool-card-icon-finance {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-finance);
}

.tool-card:hover .tool-card-icon-finance {
    background: var(--color-finance);
}

.tool-card-icon-social {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-social);
}

.tool-card:hover .tool-card-icon-social {
    background: var(--color-social);
}

.tool-card-icon-dev {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-dev);
}

.tool-card:hover .tool-card-icon-dev {
    background: var(--color-dev);
}

.tool-card-content {
    flex: 1;
}

.tool-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
}

.tool-card-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

.tool-card-badge {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-popular {
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-accent);
}

.badge-new {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
}

.badge-trending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
}

.tool-card[data-hidden="true"] {
    display: none;
}

/* ============================================
   14. AD CONTAINERS
   ============================================ */

.ad-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-slot {
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-placeholder {
    padding: var(--space-4);
}

.ad-leaderboard {
    width: 728px;
    height: 90px;
}

@media (max-width: 768px) {
    .ad-leaderboard {
        width: 320px;
        height: 50px;
    }
}

.ad-rectangle {
    width: 300px;
    height: 250px;
}

.ad-skyscraper {
    width: 100%;
    max-width: 300px;
    height: 600px;
}

.ad-anchor {
    width: 320px;
    height: 50px;
}

.ad-in-content {
    margin: var(--space-8) 0;
    padding: var(--space-4);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
}

.ad-sticky-footer {
    position: fixed;
    bottom: var(--mobile-nav-height);
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-2);
}

.ad-sticky-footer .ad-close {
    position: absolute;
    top: -12px;
    right: var(--space-4);
    width: 24px;
    height: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-lg);
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-sticky-footer .ad-close:hover {
    background: var(--color-error);
    color: white;
    border-color: var(--color-error);
}

/* ============================================
   15. FAQ SECTION
   ============================================ */

.faq-section {
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

.section-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-5);
    font-weight: 600;
    font-size: var(--text-base);
    cursor: pointer;
    list-style: none;
    transition: background var(--transition-fast);
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: var(--text-xl);
    font-weight: 400;
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
}

.faq-item[open] .faq-question::after {
    transform: rotate(45deg);
}

.faq-question:hover {
    background: var(--color-accent-subtle);
}

.faq-answer {
    padding: 0 var(--space-5) var(--space-5);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

/* ============================================
   16. MOBILE BOTTOM NAVIGATION
   ============================================ */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    display: none;
    align-items: center;
    justify-content: space-around;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    z-index: var(--z-fixed);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-4);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--color-accent);
}

.bottom-nav-item.active {
    background: var(--color-accent-subtle);
}

#mobile-theme-toggle .theme-icon-dark,
[data-theme="dark"] #mobile-theme-toggle .theme-icon-light {
    display: none;
}

[data-theme="dark"] #mobile-theme-toggle .theme-icon-dark {
    display: block;
}

/* ============================================
   17. COOKIE CONSENT BANNER
   ============================================ */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-modal);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: var(--shadow-xl);
    padding: var(--space-5);
    transform: translateY(100%);
    transition: transform var(--transition-base);
}

.cookie-banner[aria-hidden="false"] {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .cookie-banner {
        padding-bottom: calc(var(--space-5) + var(--mobile-nav-height));
    }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-6);
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

.cookie-text {
    flex: 1;
    min-width: 280px;
}

.cookie-text h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.cookie-text p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.cookie-text a {
    color: var(--color-accent);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .cookie-actions {
        justify-content: center;
    }
}

.cookie-panel {
    display: none;
    padding-top: var(--space-5);
    margin-top: var(--space-5);
    border-top: 1px solid var(--color-border);
}

.cookie-panel[aria-hidden="false"] {
    display: block;
}

.cookie-option {
    margin-bottom: var(--space-3);
}

.cookie-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
}

.cookie-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: var(--space-1);
    accent-color: var(--color-accent);
}

.cookie-option-text {
    display: flex;
    flex-direction: column;
}

.cookie-option-text strong {
    font-weight: 500;
}

.cookie-option-text small {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ============================================
   18. FOOTER
   ============================================ */

.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-12) var(--space-6) var(--space-8);
    margin-top: var(--space-16);
}

@media (max-width: 768px) {
    .footer {
        padding: var(--space-8) var(--space-4) var(--space-6);
        padding-bottom: calc(var(--space-6) + var(--mobile-nav-height) + 60px);
    }
}

.footer-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 3fr;
    gap: var(--space-12);
}

@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
}

.footer-brand .logo {
    margin-bottom: var(--space-4);
}

.footer-tagline {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    max-width: 280px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
}

@media (max-width: 768px) {
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
}

.footer-heading {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
}

.footer-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-list a {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.footer-list a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    max-width: var(--content-max-width);
    margin: var(--space-8) auto 0;
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-copyright {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.footer-social {
    display: flex;
    gap: var(--space-3);
}

.social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

/* ============================================
   19. TOOL DETAIL PAGE
   ============================================ */

.tool-detail {
    display: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-8);
}

.tool-detail[aria-hidden="false"] {
    display: block;
}

.tool-detail-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.tool-detail-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-subtle);
    border-radius: var(--radius-lg);
    color: var(--color-accent);
    flex-shrink: 0;
}

.tool-detail-info h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.tool-detail-info p {
    color: var(--color-text-secondary);
}

.tool-ui {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
}

.tool-input-group {
    margin-bottom: var(--space-4);
}

.tool-label {
    display: block;
    font-weight: 500;
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.tool-input,
.tool-textarea,
.tool-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
}

.tool-input:focus,
.tool-textarea:focus,
.tool-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-subtle);
    outline: none;
}

.tool-textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.tool-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.tool-result {
    margin-top: var(--space-5);
    padding: var(--space-5);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.tool-result-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.tool-result-value {
    font-size: var(--text-xl);
    font-weight: 600;
    font-family: var(--font-mono);
}

.tool-section {
    margin-bottom: var(--space-8);
}

.tool-section h2 {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.tool-section p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
}

.tool-section ol,
.tool-section ul {
    padding-left: var(--space-5);
    color: var(--color-text-secondary);
}

.tool-section li {
    margin-bottom: var(--space-2);
    list-style: decimal;
}

/* ============================================
   20. ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.tool-category {
    animation: slideUp 0.5s ease-out forwards;
}

.tool-category:nth-child(1) { animation-delay: 0.1s; }
.tool-category:nth-child(2) { animation-delay: 0.2s; }
.tool-category:nth-child(3) { animation-delay: 0.3s; }
.tool-category:nth-child(4) { animation-delay: 0.4s; }

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg) 25%,
        var(--color-surface-elevated) 50%,
        var(--color-bg) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   21. PRINT STYLES
   ============================================ */

@media print {
    .header,
    .sidebar,
    .mobile-nav,
    .mobile-bottom-nav,
    .ad-container,
    .cookie-banner,
    .filter-bar {
        display: none !important;
    }
    
    .layout {
        display: block;
    }
    
    .main-content {
        padding: 0;
    }
    
    .tool-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ============================================
   22. HIGH CONTRAST MODE
   ============================================ */

@media (prefers-contrast: high) {
    :root {
        --color-border: #333;
        --color-text-muted: #666;
    }
    
    [data-theme="dark"] {
        --color-border: #aaa;
        --color-text-muted: #999;
    }
    
    .tool-card:focus-within,
    .btn:focus-visible,
    .filter-pill:focus-visible {
        outline: 3px solid currentColor;
        outline-offset: 2px;
    }
}

/* ============================================
   23. LANGUAGE SWITCHER (MULTI-LANGUAGE)
   ============================================ */

.lang-switcher {
    position: relative;
    margin-right: var(--space-1);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-subtle);
}

/* Dropdown Menu Container */
.lang-dropdown {
    display: none; /* Hidden by default */
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 180px;
    padding: var(--space-2);
    z-index: var(--z-dropdown);
    flex-direction: column;
    animation: slideUp 0.2s ease-out;
}

/* Show class toggled by app.js */
.lang-dropdown.show {
    display: flex;
}

/* Individual Language Links */
.lang-dropdown a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.lang-dropdown a:hover {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.lang-dropdown a.active {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    font-weight: 600;
}

/* Active indicator (Checkmark) Styling */
.lang-dropdown a svg {
    color: var(--color-accent);
    flex-shrink: 0;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .lang-switcher {
        margin-right: 0;
    }
    
    .current-lang-text {
        display: none; /* Only show the globe icon on mobile to save space */
    }
    
    .lang-btn {
        width: 40px;
        height: 40px;
        justify-content: center;
        padding: 0;
    }

    /* Prevent dropdown from going off-screen on mobile */
    .lang-dropdown {
        right: -50px; 
    }
}

/* ============================================
   24. SEO ENHANCEMENT STYLES
   Related Tools Section & AI SEO Optimizations
   ============================================ */

/* -----------------------------------------
   24.1 Related Tools Section
   ----------------------------------------- */

.related-tools-section {
    margin-top: var(--space-12);
    padding: var(--space-8) 0;
}

.related-tools-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--space-8);
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.related-tools-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-6);
    color: var(--color-text-primary);
    text-align: center;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

.related-tool-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.related-tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-accent);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}

.related-tool-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.related-tool-card:hover::before {
    transform: scaleY(1);
}

.related-tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--color-accent-subtle);
    border-radius: var(--radius-md);
    color: var(--color-accent);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.related-tool-card:hover .related-tool-icon {
    background: var(--color-accent);
    color: white;
}

.related-tool-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.related-tool-name {
    font-weight: 600;
    font-size: var(--text-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-tool-arrow {
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
    opacity: 0;
    transform: translateX(-8px);
    transition: all var(--transition-fast);
}

.related-tool-card:hover .related-tool-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--color-accent);
}

/* Dark mode adjustments for Related Tools */
[data-theme="dark"] .related-tools-container {
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-elevated) 100%);
}

[data-theme="dark"] .related-tool-card {
    background: var(--color-surface-elevated);
}

/* Mobile responsive for Related Tools */
@media (max-width: 768px) {
    .related-tools-section {
        margin-top: var(--space-8);
        padding: var(--space-4);
    }

    .related-tools-container {
        padding: var(--space-6);
        border-radius: var(--radius-lg);
    }

    .related-tools-title {
        font-size: var(--text-lg);
        margin-bottom: var(--space-4);
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .related-tool-card {
        padding: var(--space-4);
    }

    .related-tool-icon {
        width: 40px;
        height: 40px;
    }

    .related-tool-name {
        font-size: var(--text-sm);
    }

    .related-tool-arrow {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation for Related Tools section */
@keyframes relatedToolsSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.related-tools-section {
    animation: relatedToolsSlideIn 0.5s ease-out;
}

/* Touch device adjustments */
@media (hover: none) {
    .related-tool-card:hover {
        transform: none;
    }

    .related-tool-arrow {
        opacity: 1;
        transform: translateX(0);
    }
}

/* -----------------------------------------
   24.2 SEO Content Section Styles
   For FAQ, How-To, and other SEO content
   ----------------------------------------- */

.seo-content-section {
    margin-top: var(--space-12);
    padding: var(--space-8);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
}

.seo-content-section h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
    color: var(--color-text-primary);
}

.seo-content-section h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
    color: var(--color-text-primary);
}

.seo-content-section p {
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
}

.seo-content-section ul,
.seo-content-section ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
    color: var(--color-text-secondary);
}

.seo-content-section li {
    margin-bottom: var(--space-2);
    line-height: var(--leading-relaxed);
}

.seo-content-section ul li {
    list-style-type: disc;
}

.seo-content-section ol li {
    list-style-type: decimal;
}

/* -----------------------------------------
   24.3 Enhanced FAQ Styles (SEO Optimized)
   ----------------------------------------- */

.faq-section {
    margin-top: var(--space-12);
}

.faq-section-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
    text-align: center;
    color: var(--color-text-primary);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.faq-item:hover {
    border-color: var(--color-accent);
}

.faq-item[open] {
    box-shadow: var(--shadow-md);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    font-weight: 600;
    font-size: var(--text-base);
    cursor: pointer;
    list-style: none;
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.faq-item[open] summary::after {
    transform: rotate(180deg);
}

.faq-item summary:hover {
    background: var(--color-accent-subtle);
}

.faq-answer {
    padding: 0 var(--space-6) var(--space-5);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

.faq-answer p {
    margin-bottom: var(--space-3);
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

/* Dark mode FAQ adjustments */
[data-theme="dark"] .faq-item summary::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Mobile FAQ adjustments */
@media (max-width: 768px) {
    .faq-section-title {
        font-size: var(--text-xl);
        margin-bottom: var(--space-4);
    }

    .faq-item summary {
        padding: var(--space-4) var(--space-4);
        font-size: var(--text-sm);
    }

    .faq-answer {
        padding: 0 var(--space-4) var(--space-4);
        font-size: var(--text-sm);
    }
}

/* -----------------------------------------
   24.4 Tool Summary Box (AI Search Optimized)
   ----------------------------------------- */

.tool-summary-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--color-accent-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.tool-summary-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.tool-summary-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--color-text-muted);
}

.tool-summary-value {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text-primary);
}

.tool-summary-value.highlight {
    color: var(--color-success);
}

/* -----------------------------------------
   24.5 Best For Badges (AI Search Signals)
   ----------------------------------------- */

.best-for-section {
    margin: var(--space-6) 0;
}

.best-for-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.best-for-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.best-for-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.best-for-badge:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-accent-subtle);
}

.best-for-badge svg {
    width: 14px;
    height: 14px;
    color: var(--color-success);
}

/* -----------------------------------------
   24.6 Last Updated Badge (Freshness Signal)
   ----------------------------------------- */

.last-updated {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-4);
}

.last-updated svg {
    width: 14px;
    height: 14px;
}

/* -----------------------------------------
   24.7 How-To Steps (Schema Optimized)
   ----------------------------------------- */

.how-to-section {
    margin: var(--space-8) 0;
}

.how-to-title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
    color: var(--color-text-primary);
}

.how-to-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.how-to-step {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.how-to-step:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.how-to-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-accent);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.how-to-step-content {
    flex: 1;
}

.how-to-step-title {
    font-weight: 600;
    font-size: var(--text-base);
    margin-bottom: var(--space-1);
    color: var(--color-text-primary);
}

.how-to-step-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

/* Mobile How-To adjustments */
@media (max-width: 768px) {
    .how-to-step {
        padding: var(--space-4);
    }

    .how-to-step-number {
        width: 32px;
        height: 32px;
        font-size: var(--text-xs);
    }

    .how-to-step-title {
        font-size: var(--text-sm);
    }

    .how-to-step-description {
        font-size: var(--text-xs);
    }
}

/* -----------------------------------------
   24.8 Rating Stars (Review Schema Ready)
   ----------------------------------------- */

.rating-display {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.rating-stars {
    display: inline-flex;
    gap: 2px;
}

.rating-star {
    width: 16px;
    height: 16px;
    color: var(--color-warning);
}

.rating-star.empty {
    color: var(--color-border);
}

.rating-value {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-text-primary);
}

.rating-count {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* -----------------------------------------
   24.9 Breadcrumb Navigation (Schema Ready)
   ----------------------------------------- */

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb-nav::-webkit-scrollbar {
    display: none;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
}

.breadcrumb-item a {
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--color-accent);
}

.breadcrumb-item.current {
    color: var(--color-text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--color-text-muted);
}

/* -----------------------------------------
   24.10 Table of Contents (Jump Links)
   ----------------------------------------- */

.toc-nav {
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.toc-title {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.toc-link {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.toc-link:hover {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.toc-link.active {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    font-weight: 500;
}

/* Mobile TOC - horizontal scroll */
@media (max-width: 768px) {
    .toc-nav {
        padding: var(--space-4);
    }

    .toc-list {
        flex-direction: row;
        overflow-x: auto;
        gap: var(--space-1);
        padding-bottom: var(--space-2);
    }

    .toc-link {
        white-space: nowrap;
        padding: var(--space-2) var(--space-3);
    }
}

/* -----------------------------------------
   24.11 Speakable Content Highlight
   For voice search optimization
   ----------------------------------------- */

[data-speakable="true"] {
    /* Optional: Add subtle indicator for speakable content */
}

/* -----------------------------------------
   24.12 Schema Citation IDs
   Visual indicator for cited sections
   ----------------------------------------- */

[id]:target {
    scroll-margin-top: calc(var(--header-height) + var(--space-4));
    animation: highlightTarget 2s ease-out;
}

@keyframes highlightTarget {
    0%, 50% {
        background-color: var(--color-accent-subtle);
    }
    100% {
        background-color: transparent;
    }
}