/* Text Tools Suite - Shared Styles */

/* CapabilityBase unified navigation */
:root {
    --cb-primary: #0a0a0f;
    --cb-secondary: #111118;
    --cb-accent: #6366f1;
    --cb-accent-hover: #4f46e5;
    --cb-text: #e2e8f0;
    --cb-text-muted: #94a3b8;
    --cb-border: rgba(255,255,255,0.08);
    --cb-card: rgba(255,255,255,0.03);

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: #1e293b;
    --success: #48bb78;
    --error: #f56565;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(99, 102, 241, 0.2);
    --radius: 12px;
    --radius-lg: 16px;
}
[data-theme="light"] {
    --cb-primary: #ffffff;
    --cb-secondary: #f8fafc;
    --cb-accent: #4f46e5;
    --cb-accent-hover: #4338ca;
    --cb-text: #0f172a;
    --cb-text-muted: #64748b;
    --cb-border: rgba(0,0,0,0.08);
    --cb-card: rgba(0,0,0,0.02);

    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --accent: #667eea;
    --accent-hover: #5a6fd6;
    --accent-light: #ebf4ff;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 40px rgba(102, 126, 234, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
}
[data-theme="light"] body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf5 100%);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.site-header .header-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-header .header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
}

.site-header .header-nav a:hover {
    color: var(--text-primary);
}

.site-header .header-version {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-switch {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.lang-switch a {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.lang-switch a.active {
    background: var(--accent);
    color: white;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 30px 20px 40px;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Tool Card */
.tool-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s;
}

.tool-card:hover {
    box-shadow: var(--shadow-lg);
}

.tool-card h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Tool Layout */
.tool-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.tool-full {
    grid-column: 1 / -1;
}

.input-area label,
.output-area label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

textarea {
    width: 100%;
    min-height: 250px;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.btn {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

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

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

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

.btn-success:hover {
    background: #38a169;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* Options */
.options-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.option-item input[type="checkbox"] {
    accent-color: var(--accent);
}

.option-item select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat-item {
    text-align: center;
    padding: 16px 10px;
    background: var(--bg-primary);
    border-radius: 10px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

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

/* Home Page - Tool Grid */
.tools-section {
    margin-bottom: 40px;
}

.tools-section h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.tool-card-link {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

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

.tool-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-bottom: 14px;
}

.tool-card-link h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.tool-card-link p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Content Section */
.content-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 35px;
    margin-top: 30px;
    box-shadow: var(--shadow);
}

.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.content-section h3 {
    font-size: 1.15rem;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.content-section p {
    margin-bottom: 14px;
    color: var(--text-secondary);
}

.content-section ul,
.content-section ol {
    margin-left: 24px;
    margin-bottom: 14px;
    color: var(--text-secondary);
}

.content-section li {
    margin-bottom: 6px;
}

.faq-item {
    margin-bottom: 20px;
}

.faq-item h3 {
    margin-bottom: 8px;
}

/* Related Tools */
.related-tools {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.related-tools h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.related-tool {
    padding: 14px;
    background: var(--bg-primary);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-tool:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.related-tool .icon {
    font-size: 1rem;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

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

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

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

.breadcrumb .sep {
    margin: 0 8px;
}

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

    .page-header h1 {
        font-size: 1.6rem;
    }

    .tool-card {
        padding: 20px;
    }

    .content-section {
        padding: 24px;
    }

    .site-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .toolbar {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .related-tools-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .options-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .container {
        padding: 0 16px;
    }

    .breadcrumb {
        font-size: 0.8rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    textarea {
        min-height: 140px;
        font-size: 0.9rem;
    }

    .site-footer {
        font-size: 0.8rem;
        padding: 20px 0;
    }

    .tool-icon {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .tools-section h2 {
        font-size: 1.15rem;
    }

    .content-section h2 {
        font-size: 1.2rem;
    }

    .content-section h3 {
        font-size: 1rem;
    }
}

/* Copy notification */
.copy-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

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

/* JSON output styling */
.json-output {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

.json-key { color: #e53e3e; }
.json-string { color: #38a169; }
.json-number { color: #3182ce; }
.json-boolean { color: #805ad5; }
.json-null { color: #718096; }

.cb-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(10,10,15,0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--cb-border);
}
[data-theme="light"] .cb-nav {
    background: rgba(255,255,255,0.8);
}
.cb-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    flex-wrap: nowrap;
}
.cb-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cb-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    line-height: 1;
}
.cb-logo-icon {
    width: 32px; height: 32px;
    background: var(--cb-accent);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    flex-shrink: 0;
}
.cb-nav-links {
    display: flex;
    gap: 26px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: nowrap;
    margin-left: auto;
}
.cb-nav-links a {
    color: var(--cb-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
    line-height: 1;
}
.cb-nav-links a:hover { color: var(--cb-text); }
.cb-nav-links .cb-btn {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    margin-left: 6px;
}
.cb-theme-toggle {
    background: var(--cb-card);
    border: 1px solid var(--cb-border);
    color: var(--cb-text);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 14px;
    transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.cb-theme-toggle:hover {
    background: var(--cb-accent);
    border-color: var(--cb-accent);
    color: #fff;
    transform: translateY(-1px);
}
.cb-theme-toggle:focus-visible {
    outline: 2px solid var(--cb-accent);
    outline-offset: 2px;
}
.cb-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}
.cb-btn-primary {
    background: var(--cb-accent);
    color: white;
}
.cb-btn-primary:hover { background: var(--cb-accent-hover); }
.cb-btn-secondary {
    background: transparent;
    color: var(--cb-text);
    border: 1px solid var(--cb-border);
}
.cb-btn-secondary:hover { background: var(--cb-card); }

.has-cbnav { padding-top: 64px; }

/* Comparison cards (CapabilityBase vs ChatGPT / Claude) */
.cb-cmp-cta {
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cb-cmp-cta:hover,
.cb-cmp-cta:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.28);
    border-color: var(--accent) !important;
    outline: none;
}
.cb-cmp-ref {
    cursor: default;
}
.cb-cmp-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: .02em;
    background: var(--border-color);
    color: var(--text-muted);
    vertical-align: middle;
    white-space: nowrap;
}
