/* ============================================
   THE TOKEN LEDGER - Page-specific CSS
   Claude vs GPT cost lab with tabbed demos
   ============================================ */

/* ============================================
   ARTICLE STYLES (typography + layout)
   ============================================ */

.article-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.article-intro {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.article-intro h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.article-intro p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.article-section {
    margin-bottom: 32px;
}

.article-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    margin-top: 28px;
}

.article-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 12px 0;
}

.article-section p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.article-section ul {
    margin: 16px 0 16px 28px;
    list-style: disc;
}

.article-section li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

/* ============================================
   CALLOUTS & EXAMPLE BOXES
   ============================================ */

.article-callout {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--accent-primary);
    padding: 16px 20px;
    border-radius: 8px;
    margin: 24px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.article-callout strong {
    color: var(--text-primary);
}

.example-box {
    background: rgba(139, 92, 246, 0.08);
    border-left: 3px solid var(--accent-secondary);
    padding: 16px 20px;
    border-radius: 8px;
    margin: 24px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.example-box strong {
    color: var(--text-primary);
}

.batch-example {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.batch-example strong {
    color: var(--text-primary);
}

.batch-example ul {
    margin: 12px 0 0 20px;
    list-style: none;
}

.batch-example li {
    margin-bottom: 8px;
}

.batch-example li strong {
    color: var(--accent-primary);
}

/* ============================================
   CODE BLOCKS
   ============================================ */

.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    overflow-x: auto;
}

.article-section code {
    font-family: var(--font-mono);
    font-size: 14px;
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-secondary);
}

/* ============================================
   MODEL COMPARISON TABLE
   ============================================ */

.model-comparison-table {
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.comparison-row {
    display: grid;
    grid-template-columns: 140px 1fr 120px 120px 100px;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}

.comparison-row.header {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-row .col {
    padding: 16px 12px;
    border-right: 1px solid var(--border-color);
    font-size: 14px;
    line-height: 1.5;
}

.comparison-row .col:last-child {
    border-right: none;
}

.comparison-row.header .col {
    padding: 12px;
}

.comparison-row:not(.header) .col:first-child {
    color: var(--text-primary);
    font-weight: 600;
}

.comparison-row:not(.header) .col {
    color: var(--text-secondary);
}

/* ============================================
   DEMO WRAPPER & LAYOUT
   ============================================ */

.tc-demo-section {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.32);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(59, 130, 246, 0.08));
    font-size: 12px;
    font-weight: 600;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.demo-badge {
    animation: pulse-badge 3s ease-in-out infinite;
}

.tc-demo-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.tc-demo-section > p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.tc-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    backdrop-filter: blur(24px) saturate(160%);
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    scroll-margin-top: 120px;
}
}

/* ============================================
   INPUT SECTION
   ============================================ */

.tc-input-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tc-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tc-input-container {
    position: relative;
}

.tc-input-area {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    resize: vertical;
    transition: border-color var(--transition-base);
}

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

.tc-input-area:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.tc-stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.tc-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.tc-stat-label {
    color: var(--text-secondary);
}

.tc-stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-mono);
}

.tc-stat-value.tc-highlight {
    color: var(--accent-primary);
}

/* ============================================
   SETTINGS
   ============================================ */

.tc-settings {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.tc-setting-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.tc-setting-group label {
    color: var(--text-secondary);
    font-weight: 500;
}

.tc-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.tc-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ============================================
   PROVIDER TABS
   ============================================ */

.article-list {
    margin: 16px 0 16px 28px;
    list-style: disc;
}

.article-list li {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.article-list strong {
    color: var(--text-primary);
}

.tc-provider-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tc-ptab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    touch-action: manipulation;
}

.tc-ptab:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.tc-ptab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tc-tab-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
    font-style: italic;
}

.tc-provider-panel {
    opacity: 1;
    transition: opacity var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.tc-provider-panel:not(.active) {
    display: none;
    opacity: 0;
}

/* ============================================
   MODEL GRID & CARDS
   ============================================ */

.tc-model-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .tc-model-grid {
        grid-template-columns: 1fr;
    }
}

/* 6-column grid for GPT models (wraps to 2 rows of 3) */
.tc-model-grid-6 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
    .tc-model-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .tc-model-grid-6 {
        grid-template-columns: 1fr;
    }
}

.tc-model-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all var(--transition-base);
}

.tc-model-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.tc-model-card.tc-haiku {
    --model-color: #22c55e;
}

.tc-model-card.tc-sonnet {
    --model-color: #3b82f6;
}

.tc-model-card.tc-opus {
    --model-color: #8b5cf6;
}

/* GPT-5.5 Model Colors (2026) */
.tc-model-card.tc-gpt55m {
    --model-color: #14b8a6;
}

.tc-model-card.tc-gpt55 {
    --model-color: #06b6d4;
}

.tc-model-card.tc-gpt55p {
    --model-color: #0ea5e9;
}

/* Legacy GPT Model Colors */
.tc-model-card.tc-gpt4o {
    --model-color: #3b82f6;
}

.tc-model-card.tc-gpt4t {
    --model-color: #f59e0b;
}

.tc-model-card.tc-gpt4 {
    --model-color: #ef4444;
}

.tc-model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.tc-model-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.tc-model-tier {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tc-model-tier.fast {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.tc-model-tier.balanced {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.tc-model-tier.powerful {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.tc-pricing {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.tc-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.tc-price-row span {
    color: var(--text-secondary);
}

.tc-price-row code {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 600;
}

.tc-model-cost {
    text-align: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.tc-cost-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tc-cost-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--model-color);
    font-family: var(--font-mono);
}

.tc-use-case {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   BATCH PROCESSOR
   ============================================ */

.tc-batch-section {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.tc-batch-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.tc-batch-section > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.tc-batch-controls {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.tc-batch-slider-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tc-batch-slider-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.tc-slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tc-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.tc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.tc-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.tc-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.tc-slider-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    min-width: 120px;
    font-family: var(--font-mono);
}

/* ============================================
   BATCH RESULTS TABLE
   ============================================ */

.tc-batch-results {
    margin-bottom: 16px;
}

.tc-batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 16px;
}

.tc-batch-table thead {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.tc-batch-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.tc-batch-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.tc-batch-table tbody tr:last-child td {
    border-bottom: none;
}

.tc-batch-table td:first-child {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-primary);
}

.tc-batch-table td.tc-total {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-primary);
    font-weight: 700;
}

.tc-savings {
    text-align: center;
    padding: 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    font-size: 14px;
    color: #22c55e;
    font-weight: 600;
}

/* ============================================
   DISCLAIMER
   ============================================ */

.tc-disclaimer {
    margin-top: 24px;
    padding: 16px;
    background: rgba(255, 152, 0, 0.08);
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.tc-disclaimer strong {
    color: var(--text-primary);
}

.tc-disclaimer a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.tc-disclaimer a:hover {
    text-decoration: none;
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */

html[data-theme="light"] .tc-wrap {
    background: rgba(255, 255, 255, 0.95);
    border-color: #e2e8f0;
}

html[data-theme="light"] .article-body {
    color: #0f172a;
}

html[data-theme="light"] .article-section h2,
html[data-theme="light"] .article-section h3,
html[data-theme="light"] .article-intro h2 {
    color: #0f172a;
}

html[data-theme="light"] .article-callout {
    background: rgba(59, 130, 246, 0.08);
}

html[data-theme="light"] .example-box {
    background: rgba(139, 92, 246, 0.08);
}

html[data-theme="light"] .batch-example,
html[data-theme="light"] .code-block {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

html[data-theme="light"] .article-section code {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

html[data-theme="light"] .model-comparison-table {
    background: #fff;
    border-color: #e2e8f0;
}

html[data-theme="light"] .comparison-row {
    border-bottom-color: #e2e8f0;
}

html[data-theme="light"] .comparison-row.header {
    background: #f1f5f9;
    color: #64748b;
}

html[data-theme="light"] .comparison-row:not(.header) .col:first-child {
    color: #0f172a;
}

html[data-theme="light"] .tc-input-area {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

html[data-theme="light"] .tc-input-area::placeholder {
    color: #cbd5e1;
}

html[data-theme="light"] .tc-stats {
    border-top-color: #e2e8f0;
}

html[data-theme="light"] .tc-settings {
    background: #f1f5f9;
}

html[data-theme="light"] .tc-select {
    background: #fff;
    border-color: #e2e8f0;
    color: #0f172a;
}

html[data-theme="light"] .tc-model-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

html[data-theme="light"] .tc-model-card:hover {
    border-color: #3b82f6;
}

html[data-theme="light"] .tc-model-header h3 {
    color: #0f172a;
}

html[data-theme="light"] .tc-pricing {
    border-color: #e2e8f0;
}

html[data-theme="light"] .tc-model-cost {
    background: rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .tc-batch-section {
    border-top-color: #e2e8f0;
}

html[data-theme="light"] .tc-batch-controls {
    background: #f1f5f9;
}

html[data-theme="light"] .tc-slider {
    background: #cbd5e1;
}

html[data-theme="light"] .tc-slider-value {
    color: #0f172a;
}

html[data-theme="light"] .tc-batch-table thead {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

html[data-theme="light"] .tc-batch-table th {
    border-bottom-color: #e2e8f0;
    color: #64748b;
}

html[data-theme="light"] .tc-batch-table td {
    border-bottom-color: #e2e8f0;
    color: #475569;
}

html[data-theme="light"] .tc-batch-table td:first-child {
    color: #0f172a;
}

html[data-theme="light"] .tc-batch-table td.tc-total {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
}

/* ============================================
   LEGACY MODEL STYLING
   ============================================ */

.tc-model-legacy {
    opacity: 0.65;
    border-color: var(--border-color);
    position: relative;
}

.tc-model-legacy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.02) 2px,
        rgba(0, 0, 0, 0.02) 4px
    );
    border-radius: 12px;
    pointer-events: none;
}

.tc-legacy-badge {
    display: inline-block;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    letter-spacing: 0.5px;
}

.tc-model-legacy .tc-use-case {
    color: #ef4444;
    font-weight: 500;
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */

html[data-theme="light"] .tc-disclaimer {
    background: rgba(255, 152, 0, 0.08);
    border-left-color: #f59e0b;
    color: #475569;
}

html[data-theme="light"] .tc-disclaimer strong {
    color: #0f172a;
}

html[data-theme="light"] .tc-model-legacy {
    opacity: 0.65;
}

html[data-theme="light"] .tc-legacy-badge {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

html[data-theme="light"] .tc-provider-tabs {
    border-bottom-color: #e2e8f0;
}

html[data-theme="light"] .tc-ptab {
    color: #64748b;
}

html[data-theme="light"] .tc-ptab:hover {
    color: #0f172a;
    border-color: #cbd5e1;
}

html[data-theme="light"] .tc-ptab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

html[data-theme="light"] .tc-tab-hint {
    color: #64748b;
}

@media (max-width: 768px) {
    .tc-provider-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 12px;
    }

    .tc-provider-tabs::-webkit-scrollbar {
        display: none;
    }

    .tc-ptab {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

html[data-theme="light"] .demo-badge {
    border-color: rgba(59, 130, 246, 0.24);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(96, 165, 250, 0.06));
    color: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}
