/* ============================================
   AI Chat History Cleaner Tool - Styling
   Aligned with Main Website Design System
   ============================================ */

/* ============================================
   1. TOOL PAGE HEADER
   ============================================ */

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

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

/* ============================================
   1. TOOL PAGE LAYOUT WITH SIDEBAR
   ============================================ */

.tool-layout {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: var(--space-6);
    max-width: 1400px;
    margin: 0 auto;
}

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

.tool-sidebar {
    position: sticky;
    top: calc(var(--header-height, 72px) + var(--space-4));
    height: fit-content;
}

.tool-container {
    width: 100%;
    min-width: 0;
}

/* ============================================
   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);
}

.tool-icon-cleaner {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-cleaner, #8b5cf6);
    border-color: var(--color-cleaner, #8b5cf6);
}

[data-theme="dark"] .tool-icon-cleaner {
    background: rgba(167, 139, 250, 0.15);
    color: var(--color-cleaner, #a78bfa);
    border-color: var(--color-cleaner, #a78bfa);
}

@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);
}

@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. STATS SECTION
   ============================================ */

.stats-section {
    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);
}

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

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

.stat-item {
    text-align: center;
    padding: var(--space-3);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.stat-highlight {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.stat-highlight:hover {
    background: rgba(139, 92, 246, 0.15);
}

.stat-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-1);
}

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

.stat-highlight .stat-value {
    color: var(--color-cleaner, #8b5cf6);
}

.stat-unit {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* ============================================
   4. OPTIONS PANEL
   ============================================ */

.options-panel {
    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);
}

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

.options-title svg {
    color: var(--color-cleaner, #8b5cf6);
}

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

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

.option-toggle {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.option-toggle:hover {
    background: var(--color-bg);
}

.option-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    flex-shrink: 0;
    transition: background var(--transition-fast);
}

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

.option-toggle input:checked + .toggle-slider {
    background: var(--color-cleaner, #8b5cf6);
}

.option-toggle input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

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

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

.option-label strong {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

.option-label small {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* ============================================
   5. SMART BOX - MAIN INPUT AREA
   ============================================ */

.smart-box {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.smart-box:focus-within {
    border-color: var(--color-cleaner, #8b5cf6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.smart-box-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);
}

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

.smart-box-title svg {
    color: var(--color-cleaner, #8b5cf6);
}

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

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

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

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

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

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

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

.smart-box-textarea::placeholder {
    color: var(--color-text-muted);
}

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

.smart-box-hint {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: rgba(139, 92, 246, 0.08);
    border-top: 1px solid var(--color-border);
    font-size: var(--text-sm);
    color: var(--color-cleaner, #8b5cf6);
}

.smart-box-hint svg {
    flex-shrink: 0;
}

/* ============================================
   6. OUTPUT SECTION
   ============================================ */

.output-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.output-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);
    flex-wrap: wrap;
    gap: var(--space-3);
}

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

.output-title svg {
    color: var(--color-success);
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-cleaner, #8b5cf6);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-copy.copied {
    background: var(--color-success);
}

.output-content {
    min-height: 250px;
    padding: var(--space-5);
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
    max-height: 400px;
}

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

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

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

.output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: var(--color-text-muted);
    text-align: center;
    gap: var(--space-3);
}

.output-placeholder svg {
    opacity: 0.5;
    color: var(--color-cleaner, #8b5cf6);
}

.output-placeholder p {
    font-size: var(--text-base);
    font-weight: 500;
}

.output-placeholder small {
    font-size: var(--text-sm);
    opacity: 0.8;
}

/* ============================================
   7. ACTION BUTTONS
   ============================================ */

.tool-actions {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
    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-cleaner {
    background: var(--color-cleaner, #8b5cf6);
}

.btn-cleaner:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

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

/* ============================================
   8. AD CONTAINER - SKYSCRAPER
   ============================================ */

.ad-skyscraper-container {
    width: 160px;
}

.ad-skyscraper {
    width: 160px;
    height: 600px;
    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);
    text-align: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* ============================================
   9. 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;
}

.seo-article h3 {
    font-size: var(--text-xl, 1.25rem);
    font-weight: 600;
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
    color: var(--color-text-primary);
}

/* Authority Links Styling */
.seo-article a,
.faq-answer a {
    color: var(--color-cleaner, #8b5cf6);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-fast);
}

.seo-article a:hover,
.faq-answer a:hover {
    border-bottom-color: var(--color-cleaner, #8b5cf6);
}

/* SEO Comparison Table */
.seo-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-6) 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-size: var(--text-sm);
}

.seo-comparison-table caption {
    padding: var(--space-4);
    font-weight: 600;
    color: var(--color-text-primary);
    background: rgba(139, 92, 246, 0.08);
    text-align: left;
    font-size: var(--text-base);
}

.seo-comparison-table thead {
    background: var(--color-bg);
}

.seo-comparison-table th {
    padding: var(--space-4);
    text-align: left;
    font-weight: 600;
    color: var(--color-text-primary);
    border-bottom: 2px solid var(--color-border);
}

.seo-comparison-table td {
    padding: var(--space-4);
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
}

.seo-comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.seo-comparison-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.04);
}

.seo-comparison-table td:nth-child(2) {
    font-weight: 500;
}

@media (max-width: 768px) {
    .seo-comparison-table {
        font-size: var(--text-xs, 0.75rem);
    }
    
    .seo-comparison-table th,
    .seo-comparison-table td {
        padding: var(--space-3);
    }
    
    .seo-comparison-table caption {
        font-size: var(--text-sm);
    }
}

/* SEO Ordered List */
.seo-ordered-list {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
    margin: var(--space-6) 0;
}

.seo-ordered-list li {
    position: relative;
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-12);
    margin-bottom: var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    line-height: 1.6;
    counter-increment: step-counter;
    transition: all var(--transition-fast);
}

.seo-ordered-list li:hover {
    border-color: var(--color-cleaner, #8b5cf6);
    box-shadow: var(--shadow-sm);
}

.seo-ordered-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--color-cleaner, #8b5cf6), #a855f7);
    color: white;
    font-weight: 700;
    font-size: var(--text-sm);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.seo-ordered-list li strong {
    color: var(--color-text-primary);
}

.seo-ordered-list li:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .seo-ordered-list li {
        padding-left: var(--space-10);
    }
    
    .seo-ordered-list li::before {
        width: 24px;
        height: 24px;
        font-size: var(--text-xs, 0.75rem);
    }
}

/* ============================================
   10. 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-cleaner, #8b5cf6);
    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-cleaner, #8b5cf6);
    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;
}

/* ============================================
   11. RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .smart-box-textarea {
        min-height: 200px;
    }
    
    .output-content {
        min-height: 150px;
        max-height: 300px;
    }
    
    .tool-icon-large {
        width: 48px;
        height: 48px;
    }
    
    .tool-title {
        font-size: var(--text-lg);
    }
    
    .smart-box-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
    
    .smart-box-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .output-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-copy {
        width: 100%;
        justify-content: center;
    }
    
    .tool-actions {
        gap: var(--space-2);
    }
    
    .btn {
        flex: 1;
        min-height: 44px;
    }
    
    .stats-grid {
        gap: var(--space-2);
    }
    
    .stat-value {
        font-size: var(--text-xl);
    }
}

/* ============================================
   12. PRINT STYLES
   ============================================ */

@media print {
    .header,
    .tool-actions,
    .tool-sidebar,
    .btn-text,
    .options-panel,
    .smart-box-hint {
        display: none !important;
    }
    
    .tool-layout {
        grid-template-columns: 1fr;
    }
    
    .smart-box,
    .output-section {
        page-break-inside: avoid;
        box-shadow: none;
    }
}

/* ============================================
   13. DARK MODE ADJUSTMENTS
   ============================================ */

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

[data-theme="dark"] .smart-box:focus-within {
    border-color: var(--color-cleaner, #a78bfa);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

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

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

[data-theme="dark"] .toggle-slider {
    background: var(--color-border);
}

[data-theme="dark"] .option-toggle input:checked + .toggle-slider {
    background: var(--color-cleaner, #a78bfa);
}

[data-theme="dark"] .stat-highlight {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.2);
}

[data-theme="dark"] .smart-box-hint {
    background: rgba(167, 139, 250, 0.08);
}

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

/* Override main-content for tool pages */
.main-content .tool-container {
    max-width: 100%;
}

/* Ensure tool page works without sidebar on small screens */
.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);
    }
}

/* Fix desktop-only utility if missing */
.desktop-only {
    display: block;
}

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

/* ============================================
   15. TOAST NOTIFICATION
   ============================================ */

.toast {
    position: fixed;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text-primary);
    color: var(--color-bg);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--color-success);
    color: white;
}

.toast.error {
    background: var(--color-error);
    color: white;
}

@media (max-width: 768px) {
    .toast {
        bottom: calc(var(--space-6) + 60px);
        width: calc(100% - var(--space-8));
        justify-content: center;
    }
}

/* ============================================
   16. ANIMATION EFFECTS
   ============================================ */

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

.cleaning-active .stat-highlight {
    animation: pulse 1s ease-in-out infinite;
}

/* Highlight effect for cleaned text */
.output-content.just-cleaned {
    animation: highlight-fade 1s ease-out;
}

@keyframes highlight-fade {
    0% {
        background: rgba(139, 92, 246, 0.15);
    }
    100% {
        background: transparent;
    }
}

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

/* Tool Definition - AI Search Optimization */
.tool-definition {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), transparent);
    border-left: 4px solid var(--color-cleaner, #8b5cf6);
    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(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    color: var(--color-cleaner, #8b5cf6);
    border: 1px solid rgba(139, 92, 246, 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-cleaner, #8b5cf6);
    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: rgba(139, 92, 246, 0.08);
    border-radius: var(--radius-md);
}

.last-updated svg {
    color: var(--color-cleaner, #8b5cf6);
}

/* 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-cleaner, #8b5cf6);
    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, rgba(167, 139, 250, 0.1), transparent);
}

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

[data-theme="dark"] .best-for-badges .badge {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(167, 139, 250, 0.1));
    color: var(--color-cleaner, #a78bfa);
    border-color: rgba(167, 139, 250, 0.3);
}

[data-theme="dark"] .toc a {
    color: var(--color-cleaner, #a78bfa);
}

[data-theme="dark"] .last-updated {
    background: rgba(167, 139, 250, 0.1);
}

[data-theme="dark"] .last-updated svg {
    color: var(--color-cleaner, #a78bfa);
}

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

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