/* TradeProwl-inspired restyle overlay for Polymart.
   Loaded after the native stylesheet so these rules win on the properties
   they touch; !important is used because the native CSS is generated by
   runtime hex string-replacement in style.php and can't be relied on to
   keep a stable specificity/order. Safe to delete this one file to revert.

   One centralized theme: every rule below is written once, against the
   --tp-* variables below, and works in both light and dark mode. Only the
   *values* of those variables differ per mode (picked by PHP once, here) --
   there should never be a need for a second "if ($dark)" copy of a
   structural rule elsewhere in this file just to reach light mode too. */

/* Typography lives in tokens.php (--font-body / --font-mono) and layout.css;
   this file no longer loads or sets any font family. */

:root {
    /* clean design: one source of truth, see tokens.php */
    --tp-primary: var(--color-accent-fill);
    --tp-primary-hover: var(--color-accent-hover);
    --tp-primary-dark: var(--color-accent-alt);
    --tp-accent: var(--color-highlight);
    --tp-bg: var(--color-bg);
    --tp-surface-1: var(--color-surface);
    --tp-surface-2: var(--color-surface);
    --tp-surface-3: var(--color-fill);
    --tp-surface-4: var(--color-surface-sunken);
    --tp-surface-5: var(--color-border);
    --tp-surface-6: var(--color-border-strong);
    --tp-sidebar-bg: var(--color-fill);
    --tp-text: var(--color-text);
    --tp-text-secondary: var(--color-text);
    --tp-text-dim: var(--color-text-muted);
    --tp-text-muted: var(--color-text-subtle);
    --tp-border: var(--color-border);
    --tp-shadow-hover: 0 20px 40px rgba(239, 59, 59, 0.15);
}

/* The native .icon-input .input-inner rule hardcodes a near-black
   #222222 text color with no dark-mode variant, and .icon-input's own
   background is transparent (inherits the page background) rather than
   a fixed white box -- so in dark mode this produced near-invisible
   text in every field using it, including login, register, and most of
   account.php. Tie it to the theme's text color instead. */
.icon-input .input-inner,
.icon-input .icon {
    color: var(--tp-text) !important;
}
.icon-input .input-inner::placeholder {
    color: var(--tp-text-muted) !important;
}

/* The plain .input class (forgotPassword.php, resetPassword.php,
   contact.php) hardcodes a white background + near-black text with no
   dark-mode variant at all -- rendered as a glaring white box floating
   in an otherwise dark page. */
.input {
    background-color: var(--tp-surface-2) !important;
    color: var(--tp-text) !important;
    border-color: var(--tp-border) !important;
}
.input::placeholder {
    color: var(--tp-text-muted) !important;
}

/* Primary buttons */
.button {
    background-color: var(--tp-primary) !important;
    border-color: var(--tp-primary) !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    transition: 0.17s !important;
}
.button:hover {
    background-color: var(--tp-primary-hover) !important;
    border-color: var(--tp-primary-hover) !important;
    box-shadow: var(--tp-shadow-hover);
    transform: translateY(-2px);
}
.button:active {
    background-color: var(--tp-primary-dark) !important;
}
.button.error-color {
    background-color: transparent !important;
}

/* Weak/outline buttons */
.button-weak {
    color: var(--tp-primary) !important;
    border-color: var(--tp-primary) !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
}
.button-weak:hover {
    background-color: rgba(228, 48, 48, 0.1) !important;
    color: var(--tp-primary-hover) !important;
}

/* Links / accent color usages */
.theme-color, a.theme-color, .theme-color-global, .link-color {
    color: var(--tp-primary) !important;
}
.theme-color-bg {
    background-color: var(--tp-primary) !important;
}
a:not(.button):not(.button-weak):not(.none):not(.category-button):not(.category-button-selected):not(.subheader-link):not(.pm-btn):not(.pm-tab):not(.browse-menu-item) {
    color: var(--tp-primary);
}
a:not(.button):not(.button-weak):not(.none):not(.category-button):not(.category-button-selected):not(.subheader-link):not(.pm-btn):not(.pm-tab):not(.browse-menu-item):hover {
    color: var(--tp-primary-hover);
}

/* Sub-header category bar: sits on a solid red background, so it needs its
   own white text rather than the site-wide red link color. */
.subheader-link {
    color: #ffffff !important;
}
.subheader-link:hover {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Width-only utility -- unlike .full-width (which also sets display:
   inline-block), this only touches width, so it's safe to swap in for a
   bare inline style="width: 100%" on a block-level element (div, form,
   etc.) without changing its display behavior. */
.w-100 {
    width: 100% !important;
}

/* Category filter pills -- every pill (selected or not) used to get a bold
   red border, which reads as "busy" once a row has 10+ of them. Only the
   selected pill should carry the accent now; the rest sit on a neutral
   border until hovered/chosen. */
.category-button {
    color: var(--tp-text-dim) !important;
    border-color: var(--tp-border) !important;
    background-color: var(--tp-surface-2) !important;
    font-size: 14px;
    padding: 4px 12px;
    margin: 4px;
    border-radius: 999px;
}
.category-button-selected,
.category-button-selected.theme-color,
.category-button.theme-color {
    background-color: var(--tp-primary) !important;
    border-color: var(--tp-primary) !important;
    color: #ffffff !important;
}
.category-button:hover {
    color: var(--tp-primary) !important;
    border-color: var(--tp-primary) !important;
}
.category-button-selected:hover {
    background-color: var(--tp-primary-hover) !important;
    border-color: var(--tp-primary-hover) !important;
}

/* Header / nav */
.header-tab-selected, .header-tab-selected.theme-color {
    color: var(--tp-primary) !important;
    border-color: var(--tp-primary) !important;
}
.header-button-prominent {
    background-color: var(--tp-primary) !important;
    border-color: var(--tp-primary) !important;
}
.main-header-tab.selected {
    background-color: var(--tp-primary) !important;
    color: #ffffff !important;
}
.main-header-tab.selected:hover {
    color: #ffffff !important;
}

/* Redesign step 4: resource-detail page tab nav (product.php's Overview/
   Discussion/Reviews/etc row). Was a boxed rgba-white card; flattened to a
   plain underline-tab bar matching the rest of the new design. */
.header-wrapper {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--tp-border) !important;
}
.header-button {
    font-weight: 600 !important;
    color: var(--tp-text-dim) !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    margin-right: 4px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.header-button:hover {
    color: var(--tp-text) !important;
}
.header-button.selected {
    color: var(--tp-primary) !important;
    border-bottom-color: var(--tp-primary) !important;
}

/* Layout rules for the sidebar pages moved to layout.css. This file keeps colors, borders and typography only. */

/* Match the forums page: a lighter sidebar against a differently-toned
   main content area, instead of both panels sharing the same background.
   Forums has no wrapping card -- its "page" tone IS html/body (--tp-bg).
   productlist.php/serverlist.php instead nest everything inside
   .body-container-contents, which natively hardcodes its own #242323
   background regardless of mode. Left alone in dark mode that made the
   sidebar nearly indistinguishable from it (too close in tone) while
   main-content's forced --tp-bg read as a jarring box floating inside the
   lighter wrapper -- the opposite of the intended contrast. Pin the
   wrapper to the same base tone as html/body so every page's "page-level"
   color is consistent, then main/sidebar contrast against that one tone
   the same way forums does -- in both light and dark mode. */
.body-container-contents {
    background-color: var(--tp-bg) !important;
}
.sidebar-content {
    background-color: var(--tp-sidebar-bg) !important;
    border-radius: 6px;
}
.main-content {
    background-color: var(--tp-bg) !important;
}
html, body {
    background-color: var(--tp-bg) !important;
}

.card, .card-nohover, .big-resource-card, .upgrade-card {
    background-color: var(--tp-surface-2) !important;
    border: 1px solid var(--tp-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
    transition: 0.17s !important;
}
.card:hover, .big-resource-card:hover {
    background-color: var(--tp-surface-3) !important;
    border-color: var(--tp-primary) !important;
    box-shadow: var(--tp-shadow-hover) !important;
    transform: translateY(-3px);
}
