/* Global Theme Engine - Design System */

:root {
    --gte-primary: #2563eb;
    --gte-primary-hover: #1d4ed8;
    --gte-background: #f4f6f8;
    --gte-surface: #ffffff;
    --gte-surface-2: #f8fafc;
    --gte-border: #dce2e8;
    --gte-text: #172033;
    --gte-muted: #697586;
    --gte-success: #16a34a;
    --gte-warning: #d97706;
    --gte-danger: #dc2626;
    --gte-radius: 10px;
    --gte-radius-small: 7px;
    --gte-shadow: 0 5px 20px rgba(15, 23, 42, .07);
    --gte-shadow-small: 0 2px 8px rgba(15, 23, 42, .06);
    --gte-input-height: 42px;
    --gte-transition: 160ms ease;
}

/* =========================
   THEMES
   ========================= */

html[data-gte-theme="professional"] {
    /* Hestia classic/default palette */
    --gte-primary: #e91e63;
    --gte-primary-hover: #d81b60;
    --gte-background: #ffffff;
    --gte-surface: #ffffff;
    --gte-surface-2: #f7f7f7;
    --gte-border: #e5e5e5;
    --gte-text: #3c4858;
    --gte-muted: #555555;
}

html[data-gte-theme="slate"] {
    --gte-primary: #475569;
    --gte-primary-hover: #334155;
    --gte-background: #eef1f4;
    --gte-surface: #ffffff;
    --gte-surface-2: #f5f7f9;
    --gte-border: #cbd2da;
    --gte-text: #202733;
    --gte-muted: #647080;
}

html[data-gte-theme="graphite"] {
    --gte-primary: #64748b;
    --gte-primary-hover: #475569;
    --gte-background: #dfe3e7;
    --gte-surface: #f7f8f9;
    --gte-surface-2: #eceff2;
    --gte-border: #c4cbd3;
    --gte-text: #20252b;
    --gte-muted: #66707b;
}

html[data-gte-theme="dark-professional"] {
    --gte-primary: #3b82f6;
    --gte-primary-hover: #60a5fa;
    --gte-background: #111827;
    --gte-surface: #1f2937;
    --gte-surface-2: #182230;
    --gte-border: #374151;
    --gte-text: #f3f4f6;
    --gte-muted: #9ca3af;
    --gte-shadow: 0 8px 25px rgba(0,0,0,.25);
}

html[data-gte-theme="midnight"] {
    --gte-primary: #38bdf8;
    --gte-primary-hover: #7dd3fc;
    --gte-background: #080c12;
    --gte-surface: #101722;
    --gte-surface-2: #0d141e;
    --gte-border: #263445;
    --gte-text: #e8f0f7;
    --gte-muted: #91a1b2;
    --gte-shadow: 0 10px 30px rgba(0,0,0,.35);
}

html[data-gte-theme="carbon"] {
    --gte-primary: #94a3b8;
    --gte-primary-hover: #cbd5e1;
    --gte-background: #151515;
    --gte-surface: #202020;
    --gte-surface-2: #1a1a1a;
    --gte-border: #373737;
    --gte-text: #f1f1f1;
    --gte-muted: #a1a1a1;
    --gte-shadow: 0 8px 24px rgba(0,0,0,.35);
}

html[data-gte-theme="obsidian"] {
    --gte-primary: #a78bfa;
    --gte-primary-hover: #c4b5fd;
    --gte-background: #09090b;
    --gte-surface: #18181b;
    --gte-surface-2: #111113;
    --gte-border: #34343a;
    --gte-text: #f4f4f5;
    --gte-muted: #a1a1aa;
    --gte-shadow: 0 10px 32px rgba(0,0,0,.42);
}


/* ==========================================================
   THEME ENGINE SELECTOR
   ========================================================== */
/* =========================
   SELECTOR
   ========================= */

.gte-selector {
    width: 100%;
    max-width: 340px;
    box-sizing: border-box;
    padding: 14px;
    background: var(--gte-surface);
    border: 1px solid var(--gte-border);
    border-radius: var(--gte-radius);
    box-shadow: var(--gte-shadow-small);
    color: var(--gte-text);
}

.gte-selector-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gte-text);
}

.gte-selector-icon {
    font-size: 16px;
    line-height: 1;
}

.gte-select-wrap {
    position: relative;
}

.gte-theme-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding: 0 40px 0 12px !important;
    min-height: 44px !important;
    cursor: pointer;
    background: var(--gte-surface) !important;
}

.gte-select-arrow {
    position: absolute;
    top: 50%;
    right: 13px;
    transform: translateY(-58%);
    pointer-events: none;
    color: var(--gte-muted);
    font-size: 20px;
}

.gte-theme-status {
    display: block;
    min-height: 16px;
    margin-top: 5px;
    font-size: 11px;
    color: var(--gte-muted);
}


/* =========================
   WOOCOMMERCE
   ========================= */

html[data-gte-theme] .woocommerce .quantity .qty {
    min-height: 42px;
    border-radius: var(--gte-radius-small);
}

html[data-gte-theme] .woocommerce ul.products li.product,
html[data-gte-theme] .woocommerce-page ul.products li.product {
    background: var(--gte-surface);
    border: 1px solid var(--gte-border);
    border-radius: var(--gte-radius);
    padding: 14px;
    box-shadow: var(--gte-shadow-small);
    overflow: hidden;
}

html[data-gte-theme] .woocommerce span.onsale {
    background: var(--gte-primary);
    border-radius: 999px;
    min-height: auto;
    min-width: auto;
    padding: 7px 10px;
    line-height: 1.2;
}

html[data-gte-theme] .woocommerce-message,
html[data-gte-theme] .woocommerce-info,
html[data-gte-theme] .woocommerce-error {
    border-radius: var(--gte-radius-small);
    background: var(--gte-surface);
    border: 1px solid var(--gte-border);
    color: var(--gte-text);
}

/* =========================
   RESPONSIVE / MOBILE
   ========================= */

@media (max-width: 782px) {
    .gte-selector {
        max-width: 100%;
        padding: 12px;
        border-radius: 9px;
    }

    .gte-theme-select {
        min-height: 46px !important;
        font-size: 16px !important;
    }

    html[data-gte-theme] .woocommerce ul.products[class*="columns-"] li.product,
    html[data-gte-theme] .woocommerce-page ul.products[class*="columns-"] li.product {
        width: calc(50% - 8px);
        margin-right: 0;
        margin-left: 0;
    }

    html[data-gte-theme] .woocommerce ul.products {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    html[data-gte-theme] .woocommerce ul.products li.product {
        float: none;
        width: auto !important;
        margin: 0 !important;
    }
}

@media (max-width: 480px) {
    html[data-gte-theme] .woocommerce ul.products {
        grid-template-columns: 1fr;
    }

    html[data-gte-theme] .woocommerce ul.products[class*="columns-"] li.product,
    html[data-gte-theme] .woocommerce-page ul.products[class*="columns-"] li.product {
        width: 100%;
    }
}


/* ==========================================================
   ADMIN SAFE LAYER
   Scoped to the WordPress admin and never changes layout.
   ========================================================== */

html[data-gte-admin-theme] #wpcontent,
html[data-gte-admin-theme] #wpbody,
html[data-gte-admin-theme] .wrap {
    color: var(--gte-text);
}

html[data-gte-admin-theme] .wrap h1,
html[data-gte-admin-theme] .wrap h2,
html[data-gte-admin-theme] .wrap h3,
html[data-gte-admin-theme] .wrap h4,
html[data-gte-admin-theme] .wrap h5,
html[data-gte-admin-theme] .wrap h6,
html[data-gte-admin-theme] .wrap label,
html[data-gte-admin-theme] .wrap p,
html[data-gte-admin-theme] .wrap td,
html[data-gte-admin-theme] .wrap th {
    color: var(--gte-text);
}

html[data-gte-admin-theme] .wrap input:not([type="checkbox"]):not([type="radio"]),
html[data-gte-admin-theme] .wrap select,
html[data-gte-admin-theme] .wrap textarea {
    background-color: var(--gte-surface);
    color: var(--gte-text);
    border-color: var(--gte-border);
}

html[data-gte-admin-theme] .wrap .button {
    border-color: var(--gte-border);
    color: var(--gte-text);
    background: var(--gte-surface);
}

html[data-gte-admin-theme] .wrap .button-primary {
    background: var(--gte-primary);
    border-color: var(--gte-primary);
    color: #fff;
}

html[data-gte-admin-theme] .wrap .wp-list-table {
    background: var(--gte-surface);
    border-color: var(--gte-border);
    color: var(--gte-text);
}

html[data-gte-admin-theme] .wrap .wp-list-table th,
html[data-gte-admin-theme] .wrap .wp-list-table td {
    border-color: var(--gte-border);
    color: var(--gte-text);
}

html[data-gte-admin-theme] .wrap .notice,
html[data-gte-admin-theme] .wrap .updated,
html[data-gte-admin-theme] .wrap .error {
    background: var(--gte-surface);
    border-color: var(--gte-border);
    color: var(--gte-text);
}

/* ==========================================================
   USDT EXCHANGE - FRONTEND + ADMIN
   This is compatibility CSS only. The original plugin files
   remain untouched.
   ========================================================== */

html[data-gte-theme] #usdt-exchange-app,
html[data-gte-theme] #usdt-exchange-app *,
html[data-gte-theme] .usdt-status-app,
html[data-gte-theme] .usdt-status-app * {
    --usdt-gte-text: var(--gte-text);
    --usdt-gte-muted: var(--gte-muted);
    --usdt-gte-surface: var(--gte-surface);
    --usdt-gte-surface-2: var(--gte-surface-2);
    --usdt-gte-border: var(--gte-border);
    --usdt-gte-primary: var(--gte-primary);
}

html[data-gte-theme] #usdt-exchange-app .usdt-card,
html[data-gte-theme] #usdt-exchange-app .usdt-choice,
html[data-gte-theme] #usdt-exchange-app .usdt-radio-card,
html[data-gte-theme] #usdt-exchange-app .usdt-wallet-card,
html[data-gte-theme] #usdt-exchange-app .usdt-bank-box,
html[data-gte-theme] #usdt-exchange-app .usdt-order-status-box,
html[data-gte-theme] #usdt-exchange-app .usdt-status-current,
html[data-gte-theme] .usdt-status-app .usdt-card {
    background: var(--gte-surface);
    border-color: var(--gte-border);
    color: var(--gte-text);
}

html[data-gte-theme] #usdt-exchange-app h1,
html[data-gte-theme] #usdt-exchange-app h2,
html[data-gte-theme] #usdt-exchange-app h3,
html[data-gte-theme] #usdt-exchange-app h4,
html[data-gte-theme] #usdt-exchange-app h5,
html[data-gte-theme] #usdt-exchange-app h6,
html[data-gte-theme] #usdt-exchange-app label,
html[data-gte-theme] #usdt-exchange-app strong,
html[data-gte-theme] #usdt-exchange-app .usdt-choice strong,
html[data-gte-theme] #usdt-exchange-app .usdt-field label,
html[data-gte-theme] #usdt-exchange-app .usdt-card h2,
html[data-gte-theme] #usdt-exchange-app .usdt-card h3 {
    color: var(--gte-text);
}

html[data-gte-theme] #usdt-exchange-app .usdt-muted,
html[data-gte-theme] #usdt-exchange-app small,
html[data-gte-theme] #usdt-exchange-app .usdt-choice small {
    color: var(--gte-muted);
}

html[data-gte-theme] #usdt-exchange-app .usdt-field input,
html[data-gte-theme] #usdt-exchange-app .usdt-field select,
html[data-gte-theme] #usdt-exchange-app textarea,
html[data-gte-theme] #usdt-exchange-app input[type="text"],
html[data-gte-theme] #usdt-exchange-app input[type="number"] {
    background: var(--gte-surface);
    color: var(--gte-text);
    border-color: var(--gte-border);
}

html[data-gte-theme] #usdt-exchange-app .usdt-btn {
    background: var(--gte-primary);
    border-color: var(--gte-primary);
    color: #fff;
}

html[data-gte-theme] #usdt-exchange-app table,
html[data-gte-theme] #usdt-exchange-app th,
html[data-gte-theme] #usdt-exchange-app td {
    border-color: var(--gte-border);
    color: var(--gte-text);
}

html[data-gte-theme] #usdt-exchange-app table {
    background: var(--gte-surface);
}

/* Dark themes: explicitly neutralize common light USDT surfaces. */
html[data-gte-theme="dark-professional"] #usdt-exchange-app .usdt-choice,
html[data-gte-theme="dark-professional"] #usdt-exchange-app .usdt-radio-card,
html[data-gte-theme="dark-professional"] #usdt-exchange-app .usdt-wallet-card,
html[data-gte-theme="dark-professional"] #usdt-exchange-app .usdt-bank-box,
html[data-gte-theme="dark-professional"] #usdt-exchange-app .usdt-order-status-box,
html[data-gte-theme="midnight"] #usdt-exchange-app .usdt-choice,
html[data-gte-theme="midnight"] #usdt-exchange-app .usdt-radio-card,
html[data-gte-theme="midnight"] #usdt-exchange-app .usdt-wallet-card,
html[data-gte-theme="midnight"] #usdt-exchange-app .usdt-bank-box,
html[data-gte-theme="midnight"] #usdt-exchange-app .usdt-order-status-box,
html[data-gte-theme="carbon"] #usdt-exchange-app .usdt-choice,
html[data-gte-theme="carbon"] #usdt-exchange-app .usdt-radio-card,
html[data-gte-theme="carbon"] #usdt-exchange-app .usdt-wallet-card,
html[data-gte-theme="carbon"] #usdt-exchange-app .usdt-bank-box,
html[data-gte-theme="carbon"] #usdt-exchange-app .usdt-order-status-box,
html[data-gte-theme="obsidian"] #usdt-exchange-app .usdt-choice,
html[data-gte-theme="obsidian"] #usdt-exchange-app .usdt-radio-card,
html[data-gte-theme="obsidian"] #usdt-exchange-app .usdt-wallet-card,
html[data-gte-theme="obsidian"] #usdt-exchange-app .usdt-bank-box,
html[data-gte-theme="obsidian"] #usdt-exchange-app .usdt-order-status-box {
    background: var(--gte-surface) !important;
    border-color: var(--gte-border) !important;
    color: var(--gte-text) !important;
}

/* USDT admin pages: scoped only to its own namespace. */
html[data-gte-admin-theme] .usdt-admin-dashboard,
html[data-gte-admin-theme] .usdt-resource-page,
html[data-gte-admin-theme] .usdt-admin-shell,
html[data-gte-admin-theme] .usdt-admin-panel,
html[data-gte-admin-theme] .usdt-resource-box,
html[data-gte-admin-theme] .usdt-edit-groupbox,
html[data-gte-admin-theme] .usdt-dashboard-groupbox,
html[data-gte-admin-theme] .usdt-order-editor,
html[data-gte-admin-theme] .usdt-wp-service-control {
    color: var(--gte-text);
}

html[data-gte-admin-theme] .usdt-admin-dashboard .usdt-admin-panel,
html[data-gte-admin-theme] .usdt-resource-box,
html[data-gte-admin-theme] .usdt-edit-groupbox,
html[data-gte-admin-theme] .usdt-dashboard-groupbox,
html[data-gte-admin-theme] .usdt-order-editor,
html[data-gte-admin-theme] .usdt-wp-service-control {
    background: var(--gte-surface) !important;
    border-color: var(--gte-border) !important;
}

html[data-gte-admin-theme] .usdt-admin-dashboard h1,
html[data-gte-admin-theme] .usdt-admin-dashboard h2,
html[data-gte-admin-theme] .usdt-admin-dashboard h3,
html[data-gte-admin-theme] .usdt-admin-dashboard h4,
html[data-gte-admin-theme] .usdt-resource-page h1,
html[data-gte-admin-theme] .usdt-resource-page h2,
html[data-gte-admin-theme] .usdt-resource-page h3,
html[data-gte-admin-theme] .usdt-resource-page h4,
html[data-gte-admin-theme] .usdt-admin-dashboard strong,
html[data-gte-admin-theme] .usdt-resource-page strong,
html[data-gte-admin-theme] .usdt-admin-dashboard span,
html[data-gte-admin-theme] .usdt-resource-page span {
    color: var(--gte-text);
}

html[data-gte-admin-theme] .usdt-admin-dashboard input,
html[data-gte-admin-theme] .usdt-admin-dashboard select,
html[data-gte-admin-theme] .usdt-admin-dashboard textarea,
html[data-gte-admin-theme] .usdt-resource-page input,
html[data-gte-admin-theme] .usdt-resource-page select,
html[data-gte-admin-theme] .usdt-resource-page textarea,
html[data-gte-admin-theme] .usdt-order-editor input,
html[data-gte-admin-theme] .usdt-order-editor select,
html[data-gte-admin-theme] .usdt-order-editor textarea {
    background: var(--gte-surface) !important;
    color: var(--gte-text) !important;
    border-color: var(--gte-border) !important;
}

html[data-gte-admin-theme] .usdt-admin-dashboard table,
html[data-gte-admin-theme] .usdt-admin-dashboard th,
html[data-gte-admin-theme] .usdt-admin-dashboard td,
html[data-gte-admin-theme] .usdt-resource-page table,
html[data-gte-admin-theme] .usdt-resource-page th,
html[data-gte-admin-theme] .usdt-resource-page td {
    background-color: var(--gte-surface);
    color: var(--gte-text);
    border-color: var(--gte-border);
}

/* Common inline light backgrounds used by the current USDT admin dashboard. */
html[data-gte-admin-theme="dark-professional"] .usdt-wp-service-control,
html[data-gte-admin-theme="midnight"] .usdt-wp-service-control,
html[data-gte-admin-theme="carbon"] .usdt-wp-service-control,
html[data-gte-admin-theme="obsidian"] .usdt-wp-service-control,
html[data-gte-admin-theme="dark-professional"] .usdt-admin-dashboard [style*="background:#f8fafc"],
html[data-gte-admin-theme="midnight"] .usdt-admin-dashboard [style*="background:#f8fafc"],
html[data-gte-admin-theme="carbon"] .usdt-admin-dashboard [style*="background:#f8fafc"],
html[data-gte-admin-theme="obsidian"] .usdt-admin-dashboard [style*="background:#f8fafc"] {
    background: var(--gte-surface) !important;
    border-color: var(--gte-border) !important;
    color: var(--gte-text) !important;
}

/* Do not invert images, QR codes, logos or icons. */
html[data-gte-theme] img,
html[data-gte-theme] svg,
html[data-gte-admin-theme] img,
html[data-gte-admin-theme] svg {
    filter: none;
}


/* Component aliases */
html[data-gte-theme],
html[data-gte-admin-theme] {
    --gte-input-bg: var(--gte-surface);
    --gte-input-border: var(--gte-border);
    --gte-placeholder: var(--gte-muted);
}
