/* Site-wide dark mode */

[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] body,
[data-theme="dark"] .page-inner,
[data-theme="dark"] .page-home {
    background: var(--bg);
    color: var(--text);
}

/* Header */
[data-theme="dark"] .omni-inner-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="dark"] .omni-inner-logo-bold {
    color: #f1f5f9;
}

[data-theme="dark"] .omni-inner-logo-light {
    color: #60a5fa;
}

[data-theme="dark"] .omni-header-search-input {
    background: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .omni-header-search-input::placeholder {
    color: #94a3b8;
}

[data-theme="dark"] .omni-header-search-input:focus {
    background: #0f172a;
    box-shadow: inset 0 0 0 2px #288dfd;
}

[data-theme="dark"] .omni-header-icon-btn {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .omni-header-icon-btn:hover {
    background: #475569;
}

[data-theme="dark"] .omni-mobile-toggle {
    color: #f1f5f9;
}

[data-theme="dark"] .omni-cat-nav {
    background: #1e293b;
    border-top-color: #334155;
}

[data-theme="dark"] .omni-cat-nav-link {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .omni-cat-nav-link:hover,
[data-theme="dark"] .omni-cat-nav-link.is-active {
    color: #60a5fa !important;
}

[data-theme="dark"] .omni-cat-nav-link.is-active {
    background: rgba(40, 141, 253, 0.12);
}

/* Search dropdown */
[data-theme="dark"] .omni-search-dropdown {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .omni-search-item {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .omni-search-item:hover,
[data-theme="dark"] .omni-search-item.is-highlighted {
    background: #334155;
}

[data-theme="dark"] .omni-search-item-title {
    color: #f1f5f9;
}

[data-theme="dark"] .omni-search-item-cat,
[data-theme="dark"] .omni-search-empty {
    color: #94a3b8;
}

/* Category page */
[data-theme="dark"] .category-listing {
    background: var(--bg);
}

[data-theme="dark"] .category-content-section {
    background: var(--bg);
    border-top-color: var(--border);
}

[data-theme="dark"] .category-header h1,
[data-theme="dark"] .cat-collection-title {
    color: #f1f5f9;
}

[data-theme="dark"] .category-header p,
[data-theme="dark"] .cat-search-hint {
    color: #94a3b8;
}

[data-theme="dark"] .cat-toolbar {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .cat-search-wrap {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .cat-search-wrap:focus-within {
    background: #0f172a;
    border-color: #288dfd;
}

[data-theme="dark"] .cat-search-input {
    color: #f1f5f9;
}

[data-theme="dark"] .cat-search-clear:hover {
    background: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .cat-result-badge {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    border-color: #334155;
}

[data-theme="dark"] .cat-result-num {
    color: #60a5fa;
}

[data-theme="dark"] .cat-result-label {
    color: #94a3b8;
}

[data-theme="dark"] .cat-subnav-label {
    color: #94a3b8;
}

[data-theme="dark"] .cat-sub-pill {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .cat-sub-pill:hover {
    background: #1e293b;
    border-color: #288dfd;
    color: #60a5fa;
}

[data-theme="dark"] .cat-collection-title {
    border-bottom-color: #334155;
}

[data-theme="dark"] .cat-pagination .page-link {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

/* Cards */
[data-theme="dark"] .calc-card,
[data-theme="dark"] .category-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .calc-card:hover,
[data-theme="dark"] .category-card:hover {
    border-color: #288dfd;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Footer */
[data-theme="dark"] .footer-v2,
[data-theme="dark"] .footer-main,
[data-theme="dark"] .footer-bottom {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .footer-tagline {
    color: #f1f5f9;
}

[data-theme="dark"] .footer-desc,
[data-theme="dark"] .footer-copyright {
    color: #94a3b8;
}

[data-theme="dark"] .footer-heading {
    color: #f1f5f9;
}

[data-theme="dark"] .footer-cat-grid a,
[data-theme="dark"] .footer-links a {
    color: #cbd5e1;
}

[data-theme="dark"] .footer-cat-grid a:hover,
[data-theme="dark"] .footer-links a:hover {
    color: #60a5fa;
}

[data-theme="dark"] .footer-social a {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .footer-social a:hover {
    background: #288dfd;
    color: #fff;
}

/* Homepage */
[data-theme="dark"] .omni-home {
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(127, 29, 29, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 80% 20%, rgba(30, 58, 95, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 50% 80%, rgba(88, 28, 135, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .omni-logo-calc {
    color: #f1f5f9;
}

[data-theme="dark"] .omni-hero-lead {
    color: #94a3b8;
}

[data-theme="dark"] .omni-hero-word {
    color: #f1f5f9;
}

[data-theme="dark"] .omni-search-input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .omni-search-input:focus,
[data-theme="dark"] .omni-search-input.is-active {
    border-color: #288dfd;
    box-shadow: 0 4px 24px rgba(40, 141, 253, 0.2), 0 0 0 3px rgba(40, 141, 253, 0.15);
}

[data-theme="dark"] .omni-categories-panel {
    background: #1e293b;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .omni-categories-panel::before {
    border-bottom-color: #1e293b;
}

[data-theme="dark"] .omni-category-card {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .omni-category-card:hover {
    border-color: #288dfd;
    color: #f1f5f9;
}

[data-theme="dark"] .omni-cat-name {
    color: #f1f5f9;
}

[data-theme="dark"] .omni-cat-count {
    color: #94a3b8;
}

[data-theme="dark"] .omni-section {
    background: #0f172a;
}

[data-theme="dark"] .omni-section-alt {
    background: #1e293b;
}

[data-theme="dark"] .omni-section-title {
    color: #f1f5f9;
}

[data-theme="dark"] .page-home .calc-card {
    background: #1e293b;
    border-color: #334155;
}

/* Calculator page */
[data-theme="dark"] .calc-page {
    background: var(--bg);
}

[data-theme="dark"] .calc-widget {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .calc-widget-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .calc-title {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-subtitle,
[data-theme="dark"] .calc-breadcrumb .breadcrumb-item.active {
    color: #94a3b8;
}

[data-theme="dark"] .calc-field-label {
    color: #e2e8f0;
}

[data-theme="dark"] .calc-field-unit {
    background: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .calc-field-input,
[data-theme="dark"] .calc-input-with-unit input {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .calc-field-input:focus,
[data-theme="dark"] .calc-input-with-unit input:focus {
    background: #0f172a;
    border-color: #288dfd;
}

[data-theme="dark"] .calc-field-hint {
    color: #94a3b8;
}

[data-theme="dark"] .calc-tool-btn {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] .calc-tool-btn:hover {
    background: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .calc-share-panel {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .calc-share-panel-title {
    color: #94a3b8;
}

[data-theme="dark"] .calc-share-opt {
    background: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .calc-share-opt:hover {
    background: #475569;
}

[data-theme="dark"] .calc-results-heading {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-steps-block,
[data-theme="dark"] .calc-chart-block {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .calc-steps-heading,
[data-theme="dark"] .calc-chart-heading {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-steps-list li {
    color: #cbd5e1;
    border-color: #334155;
}

[data-theme="dark"] .calc-article {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    color: #cbd5e1;
}

[data-theme="dark"] .calc-article h2,
[data-theme="dark"] .calc-article h3,
[data-theme="dark"] .calc-article h4 {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-article p,
[data-theme="dark"] .calc-article li,
[data-theme="dark"] .calc-article ol,
[data-theme="dark"] .calc-article ul,
[data-theme="dark"] .calc-article td,
[data-theme="dark"] .calc-article th {
    color: #cbd5e1;
}

[data-theme="dark"] .calc-article strong {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-article a {
    color: #60a5fa;
}

[data-theme="dark"] .calc-article a:hover {
    color: #93c5fd;
}

[data-theme="dark"] .calc-article code {
    background: #334155;
    color: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

[data-theme="dark"] .calc-table-wrap {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .calc-article .calc-ref-table thead th,
[data-theme="dark"] .calc-article table thead th,
[data-theme="dark"] .calc-article table > tr:first-child > th,
[data-theme="dark"] .calc-article table > tbody > tr:first-child > th,
[data-theme="dark"] .calc-article table:not(:has(th)) > tr:first-child > td,
[data-theme="dark"] .calc-article table:not(:has(th)) > tbody > tr:first-child > td {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #f8fafc;
}

[data-theme="dark"] .calc-article .calc-ref-table tbody td,
[data-theme="dark"] .calc-article table tbody td {
    color: #cbd5e1;
    border-bottom-color: #334155;
}

[data-theme="dark"] .calc-article .calc-ref-table tbody tr:nth-child(even) td,
[data-theme="dark"] .calc-article table tbody tr:nth-child(even) td {
    background: #1e293b;
}

[data-theme="dark"] .calc-article .calc-ref-table tbody tr:hover td,
[data-theme="dark"] .calc-article table tbody tr:hover td {
    background: #1e3a5f;
}

[data-theme="dark"] .calc-article .calc-ref-table tbody tr:hover td:first-child,
[data-theme="dark"] .calc-article table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 #60a5fa;
}

[data-theme="dark"] .calc-article .calc-ref-table tbody td:first-child,
[data-theme="dark"] .calc-article table tbody td:first-child {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-article .calc-ref-table tbody td:last-child,
[data-theme="dark"] .calc-article table tbody td:last-child {
    color: #93c5fd;
}

[data-theme="dark"] .calc-formula-box,
[data-theme="dark"] .formula-box {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border-left-color: #288dfd;
    color: #e2e8f0;
}

[data-theme="dark"] .calc-formula-box i {
    color: #60a5fa;
}

[data-theme="dark"] .calc-formula-box code {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-faq .accordion-item {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .calc-faq .accordion-button {
    background: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .calc-faq .accordion-button:not(.collapsed) {
    background: #1e3a5f;
    color: #60a5fa;
}

[data-theme="dark"] .calc-faq .accordion-button::after {
    filter: invert(1) brightness(0.85);
}

[data-theme="dark"] .calc-faq .accordion-body {
    background: #1e293b;
    color: #cbd5e1;
}

[data-theme="dark"] .calc-reviews {
    border-top-color: #334155;
}

[data-theme="dark"] .calc-reviews-summary {
    background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 100%);
    border-color: #334155;
}

[data-theme="dark"] .calc-reviews-avg {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-reviews-count {
    color: #94a3b8;
}

[data-theme="dark"] .calc-review-card {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .calc-review-card:hover {
    border-color: #475569;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .calc-review-name {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-review-date {
    color: #94a3b8;
}

[data-theme="dark"] .calc-review-text {
    color: #cbd5e1;
}

[data-theme="dark"] .calc-reviews-stars .calc-star-empty,
[data-theme="dark"] .calc-review-stars-sm .calc-star-empty {
    color: #475569;
}

[data-theme="dark"] .calc-author-photo {
    border-color: #334155;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .calc-author-name {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-author-role {
    color: #60a5fa;
}

[data-theme="dark"] .calc-author-bio {
    color: #cbd5e1;
}

[data-theme="dark"] .calc-author-stats li {
    color: #94a3b8;
}

[data-theme="dark"] .calc-author-stats i {
    color: #60a5fa;
}

[data-theme="dark"] .calc-side-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .calc-side-title {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-side-desc,
[data-theme="dark"] .calc-side-meta {
    color: #94a3b8;
}

[data-theme="dark"] .calc-related-link {
    border-bottom-color: #334155;
}

[data-theme="dark"] .calc-related-link:hover {
    border-bottom-color: #334155;
}

[data-theme="dark"] .calc-related-text {
    color: #e2e8f0;
}

[data-theme="dark"] .calc-related-link:hover .calc-related-text {
    color: #60a5fa;
}

[data-theme="dark"] .calc-embed-code {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .calc-embed-preview {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

[data-theme="dark"] .calc-embed-preview:hover {
    background: #475569;
    color: #f1f5f9;
}

/* Bootstrap overrides */
[data-theme="dark"] .breadcrumb-item a {
    color: #60a5fa;
}

[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: #64748b;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #0f172a;
    border-color: #288dfd;
    color: #f1f5f9;
}

[data-theme="dark"] .form-range::-webkit-slider-runnable-track {
    background: #475569;
}

[data-theme="dark"] .form-check-input {
    background-color: #334155;
    border-color: #475569;
}

[data-theme="dark"] .form-check-input:checked {
    background-color: #288dfd;
    border-color: #288dfd;
}

[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
    color: #f1f5f9;
}

[data-theme="dark"] .calc-toolbar {
    border-color: #334155;
}

[data-theme="dark"] .calc-checkbox-wrap {
    color: #e2e8f0;
}

[data-theme="dark"] .calc-checkbox-ui {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .calc-range-value {
    color: #60a5fa;
    background: rgba(40, 141, 253, 0.15);
}

[data-theme="dark"] .alert-success {
    background: #14532d;
    border-color: #166534;
    color: #bbf7d0;
}

[data-theme="dark"] .alert-danger {
    background: #450a0a;
    border-color: #991b1b;
    color: #fecaca;
}

[data-theme="dark"] .btn-primary {
    background: #288dfd;
    border-color: #288dfd;
}

[data-theme="dark"] .btn-primary:hover {
    background: #1a6fd4;
    border-color: #1a6fd4;
}
