/**
 * Ajustes de modo oscuro (ticketshop, excepto Adiós Apache).
 * Complementa variables en header_footer.css y estilos inline de cada página.
 */
html[data-theme="dark"]:not([data-apache]),
html.dark:not([data-apache]),
html[data-theme="dark"]:not([data-apache]) body,
html.dark:not([data-apache]) body {
    color-scheme: dark;
}

/* Countdown sobre tarjetas de eventos (home / listado) */
html[data-theme="light"]:not([data-apache]) .event-countdown-overlay,
html:not(.dark):not([data-apache]) .event-countdown-overlay {
    background: rgba(255, 255, 255, 0.98) !important;
    border-top-color: #ffffff !important;
    border-bottom-color: #b0b0b0 !important;
}

html[data-theme="light"]:not([data-apache]) .event-countdown-overlay .countdown-value,
html[data-theme="light"]:not([data-apache]) .event-countdown-overlay .countdown-value-inner,
html:not(.dark):not([data-apache]) .event-countdown-overlay .countdown-value,
html:not(.dark):not([data-apache]) .event-countdown-overlay .countdown-value-inner {
    color: #1a1a1a !important;
}

html[data-theme="light"]:not([data-apache]) .event-countdown-overlay .countdown-label-unit,
html[data-theme="light"]:not([data-apache]) .event-countdown-overlay .countdown-separator,
html:not(.dark):not([data-apache]) .event-countdown-overlay .countdown-label-unit,
html:not(.dark):not([data-apache]) .event-countdown-overlay .countdown-separator {
    color: #333333 !important;
}

html[data-theme="dark"]:not([data-apache]) .event-countdown-overlay,
html.dark:not([data-apache]) .event-countdown-overlay {
    background: rgba(0, 0, 0, 0.96) !important;
    border-top-color: #111111 !important;
    border-bottom-color: #333333 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"]:not([data-apache]) .event-countdown-overlay .countdown-value,
html[data-theme="dark"]:not([data-apache]) .event-countdown-overlay .countdown-value-inner,
html.dark:not([data-apache]) .event-countdown-overlay .countdown-value,
html.dark:not([data-apache]) .event-countdown-overlay .countdown-value-inner {
    color: #ffffff !important;
}

html[data-theme="dark"]:not([data-apache]) .event-countdown-overlay .countdown-label-unit,
html[data-theme="dark"]:not([data-apache]) .event-countdown-overlay .countdown-separator,
html.dark:not([data-apache]) .event-countdown-overlay .countdown-label-unit,
html.dark:not([data-apache]) .event-countdown-overlay .countdown-separator {
    color: #e8e8e8 !important;
}

/* Pestañas detalle evento */
html[data-theme="dark"]:not([data-apache]) .tab-button.active,
html.dark:not([data-apache]) .tab-button.active {
    color: var(--text-primary, #e8e8e8) !important;
}

html[data-theme="dark"]:not([data-apache]) .tab-button,
html.dark:not([data-apache]) .tab-button {
    color: var(--text-secondary, #b0b0b0);
}

/* Texto en contenedores con fondo claro forzado */
html[data-theme="dark"]:not([data-apache]) .bank-logo-text,
html.dark:not([data-apache]) .bank-logo-text {
    color: var(--text-primary, #e8e8e8);
}

html[data-theme="dark"]:not([data-apache]) .card-logo-container,
html.dark:not([data-apache]) .card-logo-container {
    background: var(--bg-tertiary, #333) !important;
}

/* Formularios y búsqueda.
   Excluir #mp-orders-brick-container: el Brick monta inputs/labels en el host. */
html[data-theme="dark"]:not([data-apache]) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(#mp-orders-brick-container *),
html[data-theme="dark"]:not([data-apache]) select:not(#mp-orders-brick-container *),
html[data-theme="dark"]:not([data-apache]) textarea:not(#mp-orders-brick-container *),
html.dark:not([data-apache]) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(#mp-orders-brick-container *),
html.dark:not([data-apache]) select:not(#mp-orders-brick-container *),
html.dark:not([data-apache]) textarea:not(#mp-orders-brick-container *) {
    color: var(--text-primary, #e8e8e8);
    background-color: var(--bg-tertiary, #2a2a2a);
    border-color: var(--border-color, #444);
}

html[data-theme="dark"]:not([data-apache]) input:not(#mp-orders-brick-container *)::placeholder,
html[data-theme="dark"]:not([data-apache]) textarea:not(#mp-orders-brick-container *)::placeholder,
html.dark:not([data-apache]) input:not(#mp-orders-brick-container *)::placeholder,
html.dark:not([data-apache]) textarea:not(#mp-orders-brick-container *)::placeholder {
    color: var(--text-tertiary, #888);
}

html[data-theme="dark"]:not([data-apache]) label:not(#mp-orders-brick-container *),
html[data-theme="dark"]:not([data-apache]) .form-label,
html[data-theme="dark"]:not([data-apache]) .search-label,
html.dark:not([data-apache]) label:not(#mp-orders-brick-container *),
html.dark:not([data-apache]) .form-label,
html.dark:not([data-apache]) .search-label {
    color: var(--text-secondary, #b8b8b8);
}

html[data-theme="dark"]:not([data-apache]) #mp-orders-brick-container,
html.dark:not([data-apache]) #mp-orders-brick-container {
    color-scheme: light;
}

/* Date Range Picker (CDN) */
html[data-theme="dark"]:not([data-apache]) .daterangepicker,
html.dark:not([data-apache]) .daterangepicker {
    background-color: var(--bg-secondary, #2a2a2a) !important;
    border-color: var(--border-color, #444) !important;
    color: var(--text-primary, #e8e8e8) !important;
}

html[data-theme="dark"]:not([data-apache]) .daterangepicker .calendar-table,
html[data-theme="dark"]:not([data-apache]) .daterangepicker .drp-calendar,
html.dark:not([data-apache]) .daterangepicker .calendar-table,
html.dark:not([data-apache]) .daterangepicker .drp-calendar {
    background-color: var(--bg-secondary, #2a2a2a) !important;
    color: var(--text-primary, #e8e8e8) !important;
}

html[data-theme="dark"]:not([data-apache]) .daterangepicker td.available,
html[data-theme="dark"]:not([data-apache]) .daterangepicker th,
html.dark:not([data-apache]) .daterangepicker td.available,
html.dark:not([data-apache]) .daterangepicker th {
    color: var(--text-primary, #e8e8e8) !important;
}

html[data-theme="dark"]:not([data-apache]) .daterangepicker .month,
html[data-theme="dark"]:not([data-apache]) .daterangepicker .calendar-table .next span,
html[data-theme="dark"]:not([data-apache]) .daterangepicker .calendar-table .prev span,
html.dark:not([data-apache]) .daterangepicker .month {
    color: var(--text-primary, #e8e8e8) !important;
    border-color: var(--text-secondary, #888) !important;
}

/* Texto inline gris (#666) en contenido dinámico */
html[data-theme="dark"]:not([data-apache]) [style*="color: #666"],
html[data-theme="dark"]:not([data-apache]) [style*="color:#666"],
html[data-theme="dark"]:not([data-apache]) [style*="color: #333"],
html[data-theme="dark"]:not([data-apache]) [style*="color:#333"] {
    color: var(--text-secondary, #b0b0b0) !important;
}

/* Títulos y párrafos sin variable (herencia) */
html[data-theme="dark"]:not([data-apache]) .main-container,
html[data-theme="dark"]:not([data-apache]) .event-content,
html[data-theme="dark"]:not([data-apache]) .event-details,
html[data-theme="dark"]:not([data-apache]) .venue-info,
html[data-theme="dark"]:not([data-apache]) .promotion-description,
html[data-theme="dark"]:not([data-apache]) .category-availability,
html.dark:not([data-apache]) .main-container,
html.dark:not([data-apache]) .event-content,
html.dark:not([data-apache]) .event-details {
    color: var(--text-primary, #e8e8e8);
}

html[data-theme="dark"]:not([data-apache]) h1,
html[data-theme="dark"]:not([data-apache]) h2,
html[data-theme="dark"]:not([data-apache]) h3,
html[data-theme="dark"]:not([data-apache]) h4,
html.dark:not([data-apache]) h1,
html.dark:not([data-apache]) h2,
html.dark:not([data-apache]) h3,
html.dark:not([data-apache]) h4 {
    color: var(--text-primary, #f0f0f0);
}

/* Excluir #mp-orders-brick-container: el Brick de MP monta p/span en el host
   y este `color: inherit` les pone texto claro sobre el fondo blanco del Brick. */
html[data-theme="dark"]:not([data-apache]) p:not(#mp-orders-brick-container *),
html[data-theme="dark"]:not([data-apache]) li:not(#mp-orders-brick-container *),
/* .header-wordmark: logo CARLOS TEVEZ debe seguir dorado (#C9A644), no heredar cream del header. */
html[data-theme="dark"]:not([data-apache]) span:not(.promotion-badge):not(.event-ribbon-inner):not(.availability-badge):not(.header-wordmark):not(#mp-orders-brick-container *),
html.dark:not([data-apache]) p:not(#mp-orders-brick-container *),
html.dark:not([data-apache]) li:not(#mp-orders-brick-container *) {
    color: inherit;
}

/* Modales Fantix (clases comunes) */
html[data-theme="dark"]:not([data-apache]) .modal-content,
html[data-theme="dark"]:not([data-apache]) .fantix-modal-content,
html.dark:not([data-apache]) .modal-content {
    background: var(--bg-secondary, #2a2a2a) !important;
    color: var(--text-primary, #e8e8e8) !important;
}
