/* Dark-mode overrides for the Cartzilla-based admin UI of this plugin.

   Shared by adminmenu/templates/einstellungen.tpl and backoffice.tpl — both render the same
   theme, so a rule that lived in only one of them was a tab that stayed light while its
   neighbour went dark. Loaded AFTER css/theme.min.css so it wins without stacking specificity.
*/
/* Dark-mode compatibility. The admin page is built on the (light) Cartzilla theme, so its
   white cards / modal / nav strip / light-grey base clash with the JTL dark admin. These
   overrides are scoped to :root.theme-dark and to this plugin's own #tabs-tnt_coupons
   container (which wraps both the settings content and the config modal), so light mode and
   the rest of the backend are byte-for-byte unchanged. Colours come from the admin theme's
   own CSS variables (see custom.css :root.theme-dark), so they always match the active theme. */
:root.theme-dark #tabs-tnt_coupons,
:root.theme-dark #tabs-tnt_coupons #Acz {
    background-color: var(--body-bg) !important;
    color: var(--body-color);
}
:root.theme-dark #tabs-tnt_coupons .card,
:root.theme-dark #tabs-tnt_coupons .modal-content,
:root.theme-dark #tabs-tnt_coupons .bg-light,
:root.theme-dark #tabs-tnt_coupons .bg-white {
    background-color: var(--card-bg) !important;
    color: var(--body-color);
}
:root.theme-dark #tabs-tnt_coupons .nav-pills,
:root.theme-dark #tabs-tnt_coupons .card-body,
:root.theme-dark #tabs-tnt_coupons .card-header,
:root.theme-dark #tabs-tnt_coupons .card-footer {
    background-color: transparent !important;
}
:root.theme-dark #tabs-tnt_coupons .card-body,
:root.theme-dark #tabs-tnt_coupons .card-header,
:root.theme-dark #tabs-tnt_coupons .card-footer,
:root.theme-dark #tabs-tnt_coupons .modal-body,
:root.theme-dark #tabs-tnt_coupons .modal-header,
:root.theme-dark #tabs-tnt_coupons .modal-footer,
:root.theme-dark #tabs-tnt_coupons label,
:root.theme-dark #tabs-tnt_coupons .form-label,
:root.theme-dark #tabs-tnt_coupons h1,
:root.theme-dark #tabs-tnt_coupons h2,
:root.theme-dark #tabs-tnt_coupons h3,
:root.theme-dark #tabs-tnt_coupons h4,
:root.theme-dark #tabs-tnt_coupons h5,
:root.theme-dark #tabs-tnt_coupons h6 {
    color: var(--body-color) !important;
}
:root.theme-dark #tabs-tnt_coupons .text-muted,
:root.theme-dark #tabs-tnt_coupons small {
    color: var(--dark-gray) !important;
}
:root.theme-dark #tabs-tnt_coupons .form-control,
:root.theme-dark #tabs-tnt_coupons .form-select,
:root.theme-dark #tabs-tnt_coupons .custom-select,
:root.theme-dark #tabs-tnt_coupons textarea {
    background-color: var(--input-bg) !important;
    color: var(--body-color) !important;
    border-color: var(--border-color) !important;
}
:root.theme-dark #tabs-tnt_coupons .modal-header,
:root.theme-dark #tabs-tnt_coupons .modal-footer,
:root.theme-dark #tabs-tnt_coupons .border-bottom,
:root.theme-dark #tabs-tnt_coupons .card-header,
:root.theme-dark #tabs-tnt_coupons .card-footer {
    border-color: var(--border-color) !important;
}

/* The Cartzilla theme paints its own body colour (#4b566b, a dark slate) onto anything it
   considers "text" rather than inheriting — `.fs-sm`, `.card-text`, `.list-group-item` and the
   `text-dark` utility all carry it. On the dark admin that is near-black on near-black: the
   sale conditions under every card were unreadable rather than merely low-contrast. */
:root.theme-dark #tabs-tnt_coupons .fs-sm,
:root.theme-dark #tabs-tnt_coupons .fs-ms,
:root.theme-dark #tabs-tnt_coupons .card-text,
:root.theme-dark #tabs-tnt_coupons .list-group-item,
:root.theme-dark #tabs-tnt_coupons .text-dark,
:root.theme-dark #tabs-tnt_coupons .text-body,
:root.theme-dark #tabs-tnt_coupons p,
:root.theme-dark #tabs-tnt_coupons td,
:root.theme-dark #tabs-tnt_coupons th,
:root.theme-dark #tabs-tnt_coupons li {
    color: var(--body-color) !important;
}

/* Secondary text stays secondary — but readable (#979797 on #212529, not #4b566b).
   The purple header banner keeps its own light-on-accent treatment: recolouring text that sits on
   the accent surface makes it WORSE, not better. */
:root.theme-dark #tabs-tnt_coupons .text-secondary:not(.page-title-overlap *),
:root.theme-dark #tabs-tnt_coupons .opacity-60:not(.page-title-overlap *) {
    color: var(--dark-gray) !important;
    opacity: 1;
}

/* The card border was rgba(0,0,0,.086): invisible against a dark surface, so the cards had no
   edge at all and ran into the page. */
:root.theme-dark #tabs-tnt_coupons .card,
:root.theme-dark #tabs-tnt_coupons .list-group-item,
:root.theme-dark #tabs-tnt_coupons .img-thumbnail {
    border-color: var(--border-color) !important;
}

/* The button strip is transparent in dark mode, which let the accent-purple banner behind it
   show through as a stray coloured band between the header and the first card. */
:root.theme-dark #tabs-tnt_coupons .nav-pills {
    background-color: var(--card-bg) !important;
}

/* A coupon code chip is a light-yellow highlight; its own text colour is inherited, so on dark
   it turned white-on-pale. */
:root.theme-dark #tabs-tnt_coupons mark,
:root.theme-dark #tabs-tnt_coupons .bg-warning,
:root.theme-dark #tabs-tnt_coupons .bg-info,
:root.theme-dark #tabs-tnt_coupons .bg-light-warning {
    color: #212529 !important;
}
