/* ==========================================================================
   TrustHost theme modes — page and module specific rules
   Uses the tokens from trusthost-theme-modes.css; loaded right after it.
   ========================================================================== */

/* Order form */
html[data-theme="dark"] #order-standard_cart .summary-container,
html[data-theme="dark"] #order-standard_cart #orderSummary,
html[data-theme="dark"] .sticky__order__summary__sidebar__wrapper {
    background: var(--th-surface) !important;
    border-color: var(--th-border) !important;
}
html[data-theme="dark"] .buttom__cart__submit__area,
html[data-theme="dark"] .form__btn__submit__group {
    background: rgba(11, 17, 32, 0.82) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 -1px 0 var(--th-border) !important;
}
html[data-theme="dark"] .total-due-today {
    background: var(--th-primary-soft) !important;
}

/* Footer (its stylesheet loads in <body>, after this file) */
html[data-theme="dark"] body .main__footer__wrapper.th-footer,
html[data-theme="dark"] body .th-footer {
    background: var(--th-surface) !important;
    border-color: var(--th-border) !important;
    color: var(--th-text-2) !important;
    box-shadow: var(--th-shadow-sm) !important;
}
html[data-theme="dark"] body .th-footer__bottom {
    background: var(--th-sunken) !important;
    border-color: var(--th-border) !important;
}
html[data-theme="dark"] body .th-footer__support {
    background: var(--th-surface-2) !important;
    border-color: var(--th-border-strong) !important;
}
html[data-theme="dark"] body .th-footer__copyright,
html[data-theme="dark"] body .th-footer span > small {
    color: var(--th-muted) !important;
}
html[data-theme="dark"] body .th-footer__email,
html[data-theme="dark"] body .th-footer__phone {
    color: #22d3ee !important;
}

/* Small header counters and avatar tiles */
html[data-theme="dark"] .header__head__item___number {
    background: var(--th-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 2px var(--th-bg) !important;
}
html[data-theme="dark"] .th-dash-avatar {
    background: var(--th-primary-soft-2) !important;
    color: #93c5fd !important;
    border-color: transparent !important;
}
html[data-theme="dark"] .th-article-head,
html[data-theme="dark"] .knowledgebase__article__text h2,
html[data-theme="dark"] .knowledgebase__article__text h3 {
    border-color: var(--th-border) !important;
}

/* Secondary (tab) menu active pill: #3b82f6 + white text fails AA */
html[data-theme="dark"] body .full__width__secondarysidebar__menu .nav-item .nav-link.active,
html[data-theme="dark"] body .full__width__secondarysidebar__menu .nav-item.active .nav-link {
    background: var(--th-primary-hover) !important;
    border-color: var(--th-primary-hover) !important;
    color: #ffffff !important;
}

/* Announcements list */
html[data-theme="dark"] .th-announcement-title a {
    color: var(--th-text) !important;
}
html[data-theme="dark"] .th-announcement-title a:hover,
html[data-theme="dark"] .th-announcement-read-btn,
html[data-theme="dark"] .th-announcement-read-btn span,
html[data-theme="dark"] .th-announcement-type-pill,
html[data-theme="dark"] .th-announcement-type-pill span {
    color: var(--th-link) !important;
}
html[data-theme="dark"] .th-announcement-type-pill {
    background: var(--th-primary-soft) !important;
}

/* Plan catalog modules (trusthost_vps_plans, trusthost_cloud_host_plans).
   Their own html.dark rules use a different slate; align them to the tokens. */
html[data-theme="dark"] .thvps-tabs-wrapper,
html[data-theme="dark"] .thhost-tabs-wrapper,
html[data-theme="dark"] .thvps-card,
html[data-theme="dark"] .thhost-card,
html[data-theme="dark"] .thvps-scope-btn,
html[data-theme="dark"] .thvps-country-card {
    background: var(--th-surface) !important;
    border-color: var(--th-border) !important;
    box-shadow: var(--th-shadow-sm) !important;
}
html[data-theme="dark"] .thvps-card:hover,
html[data-theme="dark"] .thhost-card:hover,
html[data-theme="dark"] .thvps-scope-btn:hover,
html[data-theme="dark"] .thvps-country-card:hover {
    border-color: var(--th-border-strong) !important;
    box-shadow: var(--th-shadow-md) !important;
}
html[data-theme="dark"] .thvps-scope-btn.active {
    border-color: var(--th-primary) !important;
    background: var(--th-primary-soft) !important;
}
html[data-theme="dark"] .thvps-card-header,
html[data-theme="dark"] .thhost-card-header,
html[data-theme="dark"] .thvps-foreign-bar {
    border-color: var(--th-border) !important;
}
html[data-theme="dark"] .thvps-price-box,
html[data-theme="dark"] .thhost-price-box,
html[data-theme="dark"] .thvps-spec-icon,
html[data-theme="dark"] .thhost-spec-icon {
    background: var(--th-sunken) !important;
}
html[data-theme="dark"] .thvps-scope-btn:not(.active) .thvps-scope-icon {
    background: var(--th-surface-3) !important;
    color: var(--th-text-2) !important;
}
html[data-theme="dark"] .thvps-plan-badge,
html[data-theme="dark"] .thhost-plan-badge {
    background: var(--th-primary-soft-2) !important;
    color: #93c5fd !important;
}
html[data-theme="dark"] .thvps-plan-title,
html[data-theme="dark"] .thhost-plan-title,
html[data-theme="dark"] .thvps-scope-title,
html[data-theme="dark"] .thvps-country-name,
html[data-theme="dark"] .thvps-foreign-title {
    color: var(--th-text) !important;
}
html[data-theme="dark"] .thvps-specs-list,
html[data-theme="dark"] .thvps-specs-list li,
html[data-theme="dark"] .thvps-specs-list b,
html[data-theme="dark"] .thhost-specs-list,
html[data-theme="dark"] .thhost-specs-list li,
html[data-theme="dark"] .thhost-specs-list b,
html[data-theme="dark"] .thvps-spec-item,
html[data-theme="dark"] .thhost-spec-item {
    color: var(--th-text-2) !important;
}
html[data-theme="dark"] .thvps-tab-description,
html[data-theme="dark"] .thhost-tab-description,
html[data-theme="dark"] .thvps-scope-sub,
html[data-theme="dark"] .thvps-country-meta,
html[data-theme="dark"] .thvps-foreign-title small,
html[data-theme="dark"] .thvps-price-period,
html[data-theme="dark"] .thhost-price-period {
    color: var(--th-muted) !important;
}
html[data-theme="dark"] .thvps-price-amount,
html[data-theme="dark"] .thhost-price-amount,
html[data-theme="dark"] .thhost-price-amount small {
    color: var(--th-link) !important;
}
html[data-theme="dark"] .thvps-back-btn {
    background: var(--th-surface-2) !important;
    border-color: var(--th-border-strong) !important;
    color: var(--th-text) !important;
}
html[data-theme="dark"] .thvps-tab-btn:not(.active),
html[data-theme="dark"] .thhost-tab-btn:not(.active) {
    color: var(--th-muted) !important;
}

/* Inline-styled light panels in server-module templates (e.g. HOSTKEY provisioning) */
html[data-theme="dark"] div[style*="background:#f8fafc"],
html[data-theme="dark"] div[style*="background: #f8fafc"],
html[data-theme="dark"] div[style*="background:#fff"],
html[data-theme="dark"] div[style*="background: #fff"],
html[data-theme="dark"] div[style*="background:#ffffff"],
html[data-theme="dark"] div[style*="background: #ffffff"] {
    background: var(--th-surface) !important;
    border-color: var(--th-border) !important;
    color: var(--th-text-2) !important;
}
html[data-theme="dark"] div[style*="background:#f8fafc"] h3,
html[data-theme="dark"] div[style*="background: #f8fafc"] h3 {
    color: #93c5fd !important;
}
html:not([data-theme="dark"]) .thhost-plan-badge,
html:not([data-theme="dark"]) .thhost-price-amount small {
    color: #0369a1 !important;
}

/* Status badges (services, invoices, tickets). Light: AA text; dark: tinted. */
html:not([data-theme="dark"]) .status-active,
html:not([data-theme="dark"]) .status-paid,
html:not([data-theme="dark"]) .th-status-active,
html:not([data-theme="dark"]) .th-status-paid,
html:not([data-theme="dark"]) .th-status-completed { color: #047857 !important; }
html:not([data-theme="dark"]) .status-answered { color: #15803d !important; }
html:not([data-theme="dark"]) .status-pending,
html:not([data-theme="dark"]) .th-status-pending { color: #b45309 !important; }
html:not([data-theme="dark"]) .status-customer-reply { color: #c2410c !important; }
html:not([data-theme="dark"]) .status-terminated,
html:not([data-theme="dark"]) .status-cancelled,
html:not([data-theme="dark"]) .status-closed,
html:not([data-theme="dark"]) .th-status-terminated,
html:not([data-theme="dark"]) .th-status-cancelled { color: #475569 !important; }
html:not([data-theme="dark"]) .status-unpaid,
html:not([data-theme="dark"]) .status-suspended,
html:not([data-theme="dark"]) .th-status-unpaid,
html:not([data-theme="dark"]) .th-status-suspended { color: #b91c1c !important; }
html:not([data-theme="dark"]) span.textgreen { color: inherit !important; }

html[data-theme="dark"] .status-active,
html[data-theme="dark"] .status-paid,
html[data-theme="dark"] .status-answered,
html[data-theme="dark"] .th-status-active,
html[data-theme="dark"] .th-status-paid,
html[data-theme="dark"] .th-status-completed {
    background: rgba(16, 185, 129, 0.14) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}
html[data-theme="dark"] .status-pending,
html[data-theme="dark"] .status-customer-reply,
html[data-theme="dark"] .th-status-pending {
    background: rgba(245, 158, 11, 0.14) !important;
    color: #fcd34d !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}
html[data-theme="dark"] .status-unpaid,
html[data-theme="dark"] .status-suspended,
html[data-theme="dark"] .th-status-unpaid,
html[data-theme="dark"] .th-status-suspended,
html[data-theme="dark"] .th-status-fraud {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}
html[data-theme="dark"] .status-open {
    background: rgba(59, 130, 246, 0.16) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}
html[data-theme="dark"] .status-terminated,
html[data-theme="dark"] .status-cancelled,
html[data-theme="dark"] .status-closed,
html[data-theme="dark"] .th-status-terminated,
html[data-theme="dark"] .th-status-cancelled,
html[data-theme="dark"] .th-status-refunded,
html[data-theme="dark"] .th-status-draft {
    background: var(--th-surface-3) !important;
    color: var(--th-text-2) !important;
    border-color: var(--th-border-strong) !important;
}
html[data-theme="dark"] .status span,
html[data-theme="dark"] .th-status-pill span:not([class*="dot"]),
html[data-theme="dark"] span.textgreen {
    color: inherit !important;
}
/* Ticket status labels coloured inline by WHMCS (style="background-color:..") */
html[data-theme="dark"] td.col-ticket-status .label.status:not([class*="status-"]) {
    background: var(--th-surface-3) !important;
    color: var(--th-text) !important;
}

/* Dashboard list icons */
html[data-theme="dark"] .th-dash-item-icon.th-item-icon-blue {
    background: var(--th-primary-soft-2) !important;
    color: #93c5fd !important;
}
html[data-theme="dark"] .th-dash-item-icon.th-item-icon-cyan {
    background: rgba(6, 182, 212, 0.14) !important;
    color: #22d3ee !important;
}

/* Product details: spec boxes */
html[data-theme="dark"] .th-spec-box {
    background: var(--th-surface-2) !important;
    border-color: var(--th-border) !important;
}
html[data-theme="dark"] .th-spec-box .text-primary,
html[data-theme="dark"] .th-spec-box a {
    color: var(--th-link) !important;
}
html[data-theme="dark"] .vcenter-spec-meta,
html[data-theme="dark"] .stat-value small,
html[data-theme="dark"] bdi > small {
    color: var(--th-muted) !important;
}

/* Invoice view */
html[data-theme="dark"] .th-item-desc-text {
    color: var(--th-text-2) !important;
}
html[data-theme="dark"] .th-grand-total-val {
    color: var(--th-link) !important;
}
html[data-theme="dark"] .th-balance-row td {
    color: #f87171 !important;
}

/* Ticket view: author line and tables inside messages */
html[data-theme="dark"] .posted__by__date h6 {
    color: var(--th-muted) !important;
}
html[data-theme="dark"] .ticket-reply table,
html[data-theme="dark"] .message table,
html[data-theme="dark"] .table-responsive > table:not(.table) {
    background: var(--th-surface) !important;
    color: var(--th-text-2) !important;
}
html[data-theme="dark"] .table-responsive > table:not(.table) th,
html[data-theme="dark"] .table-responsive > table:not(.table) td {
    background: transparent !important;
    color: var(--th-text-2) !important;
    border-color: var(--th-border) !important;
}
html[data-theme="dark"] .table-responsive > table:not(.table) th {
    background: var(--th-surface-2) !important;
    color: var(--th-text) !important;
}
html[data-theme="dark"] .table-responsive > table:not(.table) strong {
    color: var(--th-text) !important;
}

/* Upgrade / traffic purchase */
html[data-theme="dark"] .thtr-choice-rate {
    color: var(--th-muted) !important;
}
html[data-theme="dark"] .thtr-history-applied {
    color: #6ee7b7 !important;
}
html[data-theme="dark"] .thtr-history-pending {
    color: #fcd34d !important;
}

/* Light-mode AA fixes for Bootstrap defaults and pale helper text */
html:not([data-theme="dark"]) body,
html:not([data-theme="dark"]) body.theme-style-two {
    --color-texts-opacity: #64748b;
}
html:not([data-theme="dark"]) .text-primary,
html:not([data-theme="dark"]) .ticket-subject.unread {
    color: #2563eb !important;
}
html:not([data-theme="dark"]) .text-success,
html:not([data-theme="dark"]) .th-total-line .font-weight-600 {
    color: #047857 !important;
}
html:not([data-theme="dark"]) .th-text-danger,
html:not([data-theme="dark"]) .text-danger:not(.side__bar__item__text) {
    color: #dc2626 !important;
}
html:not([data-theme="dark"]) .vcenter-spec-meta,
html:not([data-theme="dark"]) .thtr-choice-rate,
html:not([data-theme="dark"]) .thtr-usage,
html:not([data-theme="dark"]) .th-coloc-step-text {
    color: #64748b !important;
}
html:not([data-theme="dark"]) .label.requestor-type-operator,
html:not([data-theme="dark"]) .label-info {
    color: #0e7490 !important;
}
html[data-theme="dark"] .label.requestor-type-operator,
html[data-theme="dark"] .label-info {
    background: rgba(6, 182, 212, 0.14) !important;
    color: #67e8f9 !important;
}

/* GPU call-to-action on the cart category page: white on #f59e0b is 2.1:1 */
#order-standard_cart .th-gpu-cta,
a.btn.th-gpu-cta {
    background: #b45309 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px -6px rgba(180, 83, 9, 0.55);
}
#order-standard_cart .th-gpu-cta:hover,
a.btn.th-gpu-cta:hover {
    background: #92400e !important;
    color: #ffffff !important;
}

/* "New" badge on the active sidebar item: solid pill instead of translucent white */
.sidebar .th-nav-item.active .th-nav-badge {
    background: #ffffff !important;
    color: #1d4ed8 !important;
}

/* Cart category page: "your services" list (inline-styled in products.tpl) */
html[data-theme="dark"] .list-group-item {
    background: var(--th-surface) !important;
    border-color: var(--th-border) !important;
    color: var(--th-text-2) !important;
}
html[data-theme="dark"] .list-group-item-action:hover,
html[data-theme="dark"] .list-group-item-action:focus {
    background: var(--th-surface-2) !important;
}
html[data-theme="dark"] .list-group-item .text-dark {
    color: var(--th-text) !important;
}
html[data-theme="dark"] .stat-icon-sm {
    background: var(--th-primary-soft-2) !important;
    color: #93c5fd !important;
}
html[data-theme="dark"] .badge-success {
    background: rgba(16, 185, 129, 0.14) !important;
    color: #6ee7b7 !important;
}
