/* ============================================
   AI Text Compare Tool - Styling
   Aligned with GoForTool Design System
   ============================================ */

/* ============================================
   1. TOOL PAGE MAIN CONTAINER
   ============================================ */

.tool-page-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-6);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tool-page-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.back-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.back-button:hover {
    background: var(--color-accent);
    color: white;
}



.tool-page-main {
    max-width: var(--content-max-width, 1400px);
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
    min-height: calc(100vh - var(--header-height, 72px));
}

@media (max-width: 1024px) {
    .tool-page-main {
        padding: var(--space-6) var(--space-4);
    }
}

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

.tool-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   2. TOOL HEADER SECTION
   ============================================ */

.tool-header {
    margin-bottom: var(--space-6);
}

.tool-header-content {
    display: flex;
    gap: var(--space-6);
    align-items: flex-start;
    margin-bottom: var(--space-5);
}

@media (max-width: 768px) {
    .tool-header-content {
        flex-direction: column;
        gap: var(--space-4);
    }
}

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

@media (max-width: 768px) {
    .tool-icon-large {
        width: 64px;
        height: 64px;
    }
}

.tool-header-info {
    flex: 1;
}

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

.text-gradient {
    background: linear-gradient(135deg, var(--color-accent) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.tool-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
}

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

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

.badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

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

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

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

/* ============================================
   3. STATISTICS SECTION
   ============================================ */

.stats-section {
    margin-bottom: var(--space-6);
}

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

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

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

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.stat-icon-match {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-accent);
}

.stat-icon-added {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon-removed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-icon-changes {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--color-text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   4. OPTIONS BAR
   ============================================ */

.options-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.options-group {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-switch {
    background: var(--color-accent);
}

.toggle-input:checked + .toggle-switch::after {
    transform: translateX(18px);
}

.toggle-input:focus-visible + .toggle-switch {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.toggle-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
}

.options-actions {
    display: flex;
    gap: var(--space-2);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
}

/* ============================================
   5. COMPARE INTERFACE - DUAL PANE
   ============================================ */

.compare-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

@media (max-width: 1024px) {
    .compare-interface {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
}

.compare-pane {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.compare-pane:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
}

.original-pane .pane-header {
    border-bottom-color: rgba(239, 68, 68, 0.2);
}

.changed-pane .pane-header {
    border-bottom-color: rgba(34, 197, 94, 0.2);
}

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

.pane-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text-primary);
}

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

.btn-text {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.btn-text:hover {
    background: var(--color-accent-subtle);
    transform: translateY(-1px);
}

.btn-text:active {
    transform: scale(0.98);
}

.pane-body {
    position: relative;
    flex: 1;
    min-height: 350px;
}

.compare-textarea {
    width: 100%;
    height: 100%;
    min-height: 350px;
    padding: var(--space-5);
    border: none;
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    font-family: var(--font-mono);
    resize: vertical;
    outline: none;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.compare-textarea::-webkit-scrollbar {
    width: 8px;
}

.compare-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.compare-textarea::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

.compare-textarea::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

.compare-textarea::placeholder {
    color: var(--color-text-muted);
    font-family: var(--font-sans);
}

.compare-textarea:focus {
    background: var(--color-surface-elevated);
}

/* Diff Output */
.diff-output {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--space-5);
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    font-family: var(--font-mono);
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    display: none;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.diff-output::-webkit-scrollbar {
    width: 8px;
}

.diff-output::-webkit-scrollbar-track {
    background: transparent;
}

.diff-output::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

.diff-output.active {
    display: block;
}

/* Diff Highlighting */
.diff-added {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    text-decoration: underline;
    text-decoration-color: rgba(34, 197, 94, 0.5);
    border-radius: 2px;
    padding: 0 2px;
}

.diff-removed {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    text-decoration: line-through;
    text-decoration-color: rgba(239, 68, 68, 0.5);
    border-radius: 2px;
    padding: 0 2px;
}

[data-theme="dark"] .diff-added {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

[data-theme="dark"] .diff-removed {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.pane-footer {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.pane-stats {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

.stat-item svg {
    opacity: 0.6;
}

/* ============================================
   6. ACTION BUTTONS
   ============================================ */

.tool-actions {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .tool-actions {
        flex-direction: column;
    }
}

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

.btn-large {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
    font-weight: 600;
}

@media (max-width: 768px) {
    .btn-large {
        width: 100%;
    }
}

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

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

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-ghost:hover {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

/* Loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   7. DIFF LEGEND
   ============================================ */

.diff-legend {
    display: none;
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-8);
}

.diff-legend.visible {
    display: block;
}

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

.legend-items {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
}

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

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
}

.legend-color-added {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.legend-color-removed {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.legend-color-unchanged {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
}

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

/* ============================================
   8. SEO CONTENT SECTION
   ============================================ */

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

.seo-article {
    margin-bottom: var(--space-8);
}

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

.seo-article p {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-4);
}

.seo-article p:last-child {
    margin-bottom: 0;
}

/* ============================================
   9. FAQ SECTION
   ============================================ */

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

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

.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;
    transition: all var(--transition-fast);
}

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

.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);
    color: var(--color-text-primary);
    background: var(--color-surface);
    border: none;
    text-align: left;
}

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

.faq-question::after {
    content: '+';
    font-size: var(--text-xl);
    font-weight: 400;
    color: var(--color-accent);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
    margin-left: var(--space-3);
}

.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);
    font-size: var(--text-base);
}

.faq-answer p {
    margin: 0;
}

/* ============================================
   10. RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .compare-textarea,
    .diff-output {
        min-height: 250px;
    }
    
    .pane-body {
        min-height: 250px;
    }
    
    .tool-icon-large {
        width: 48px;
        height: 48px;
    }
    
    .tool-title {
        font-size: var(--text-lg);
    }
    
    .pane-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
    
    .pane-stats {
        gap: var(--space-3);
    }
    
    .stat-item {
        font-size: 10px;
    }
    
    .options-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .options-group {
        justify-content: flex-start;
    }
    
    .options-actions {
        justify-content: flex-end;
    }
    
    .stats-section .stat-card {
        padding: var(--space-3);
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
    }
    
    .stat-value {
        font-size: var(--text-lg);
    }
}

/* ============================================
   11. PRINT STYLES
   ============================================ */

@media print {
    .header,
    .tool-actions,
    .options-bar,
    .btn-text {
        display: none;
    }
    
    .compare-interface {
        grid-template-columns: 1fr;
    }
    
    .compare-pane {
        page-break-inside: avoid;
        box-shadow: none;
    }
}

/* ============================================
   12. DARK MODE ADJUSTMENTS
   ============================================ */

[data-theme="dark"] .compare-pane {
    border-color: var(--color-border);
}

[data-theme="dark"] .compare-textarea,
[data-theme="dark"] .diff-output {
    background: var(--color-surface);
}

[data-theme="dark"] .compare-textarea:focus {
    background: var(--color-surface-elevated);
}

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

[data-theme="dark"] .options-bar {
    background: var(--color-surface);
}

/* ============================================
   13. ACCESSIBILITY
   ============================================ */

.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: 9999;
    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);
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   14. ANIMATIONS
   ============================================ */

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

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

.stats-section {
    animation: fadeIn 0.5s ease-out;
}

.compare-pane {
    animation: slideUp 0.5s ease-out forwards;
}

.compare-pane:nth-child(2) {
    animation-delay: 0.1s;
}

/* ============================================
   15. TOOL PAGE SPECIFIC OVERRIDES
   ============================================ */

.main-content .tool-container {
    max-width: 1200px;
    margin: 0 auto;
}

.main-content {
    padding: var(--space-8) var(--space-6);
    min-height: calc(100vh - var(--header-height, 72px));
}

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

.desktop-only {
    display: inline;
}

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

/* ============================================
   16. SEO ENHANCEMENT STYLES
   AI Search & Voice Search Optimization
   ============================================ */

/* Tool Definition - AI Search Optimization */
.tool-definition {
    background: linear-gradient(135deg, var(--color-accent-subtle), transparent);
    border-left: 4px solid var(--color-accent);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-6);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.tool-definition strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* Quick Summary Box - AI Crawler Friendly */
.tool-summary {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.tool-summary h2 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.tool-summary h2::before {
    content: '⚡';
}

.tool-summary ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tool-summary li {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border-subtle);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.tool-summary li:last-child {
    border-bottom: none;
}

.tool-summary li strong {
    color: var(--color-text-primary);
    min-width: 80px;
    display: inline-block;
}

/* Best For Badges - Use Case Indicators */
.best-for-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-4) 0;
}

.best-for-badges .badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

/* Table of Contents - Jump Links */
.toc {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-6);
}

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

.toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc li {
    margin-bottom: var(--space-2);
}

.toc a {
    color: var(--color-accent);
    text-decoration: none;
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: all var(--transition-fast);
}

.toc a::before {
    content: '→';
    opacity: 0;
    transform: translateX(-5px);
    transition: all var(--transition-fast);
}

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

.toc a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Last Updated - Freshness Signal */
.last-updated {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-6);
    padding: var(--space-2) var(--space-3);
    background: var(--color-accent-subtle);
    border-radius: var(--radius-md);
}

.last-updated svg {
    color: var(--color-accent);
}

/* Related Tools Section */
.related-tools-section {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
}

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

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

.related-tool-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: block;
}

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

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

.related-tool-card p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

/* Dark Mode Adjustments for SEO Elements */
[data-theme="dark"] .tool-definition {
    background: linear-gradient(135deg, var(--color-accent-subtle), transparent);
}

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

[data-theme="dark"] .best-for-badges .badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
}

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

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