/* ==========================================================================
   BeatLatin — Overrides de módulos por tema (light / dark)
   Reproductor → global-media-player/player.css
   ========================================================================== */

[data-theme="light"] .bl-home-featured-item__title,
[data-theme="light"] .bl-search-result__title,
[data-theme="light"] .remix-title-main,
[data-theme="light"] .remix-title-link {
    color: var(--bl-system-primary, var(--bl-table-title)) !important;
}

[data-theme="light"] .bl-home-featured-item__artist,
[data-theme="light"] .bl-search-result__artist,
[data-theme="light"] .remix-title-artist {
    color: var(--bl-system-secondary, var(--bl-table-artist)) !important;
}

[data-theme="light"] .bl-home-featured-item {
    border-top-color: var(--bl-border) !important;
}

[data-theme="light"] .dj-preview-container,
[data-theme="light"] .dj-avatar-interactive,
[data-theme="light"] .avatar-placeholder-single,
[data-theme="light"] .dj-album-art-placeholder {
    background: var(--bl-art-bg) !important;
    box-shadow: var(--bl-art-shadow) !important;
}

[data-theme="light"] .bl-global-search .bl-search-result .bl-mixes-row__play {
    --bl-featured-photo-bg: #e6e6ea;
    background: var(--bl-featured-photo-bg, #e6e6ea) !important;
    box-shadow: none !important;
}

[data-theme="light"] .dj-album-art,
[data-theme="light"] .remix-grid-wrapper .dj-album-art {
    background: var(--bl-art-bg);
}

[data-theme="light"] .bl-global-search .bl-search-result .bl-mixes-row__art,
[data-theme="light"] .bl-global-search .bl-search-result .bl-mixes-row__art--placeholder {
    background: var(--bl-featured-photo-bg, #e6e6ea) !important;
}

[data-theme="light"] .player-cover-link,
[data-theme="light"] .player-cover,
[data-theme="light"] .player-cover-fallback {
    --bl-featured-photo-bg: #e6e6ea;
    background: var(--bl-featured-photo-bg, #e6e6ea) !important;
    box-shadow: none !important;
    border: none !important;
}

/* Botones compra y tablas → ver tables-theme.css */

[data-theme="light"] .remix-grid-wrapper .remix-row.now-playing .dj-preview-container {
    background: var(--bl-art-bg) !important;
    color: var(--bl-red) !important;
}

[data-theme="light"] .bl-context-menu-glass {
    --bl-ctxmenu-bg: var(--bl-glass-elevated-fallback, #f0f0f0);
    --bl-ctxmenu-bg-blur: var(--bl-glass-elevated-bg, rgba(246, 246, 246, 0.72));
    --bl-ctxmenu-border: var(--bl-glass-inner-stroke, rgba(255, 255, 255, 0.2));
    --bl-ctxmenu-shadow-color: var(--bl-glass-elevated-shadow, rgba(0, 0, 0, 0.16));
    /* Apple claro: divisor #00000026 · texto/iconos #000000e0 */
    --bl-ctxmenu-divider: rgba(0, 0, 0, 0.15);
    --bl-ctxmenu-item-hover: var(--bl-glass-elevated-hover, rgba(0, 0, 0, 0.05));
    --bl-ctxmenu-icon: rgba(0, 0, 0, 0.88);
    --bl-ctxmenu-text: rgba(0, 0, 0, 0.88);
    --bl-ctxmenu-text-hover: #000000;
}

[data-theme="light"] .bl-context-menu-list .bl-action-item {
    color: rgba(0, 0, 0, 0.88);
}

[data-theme="light"] .bl-context-menu-list .bl-action-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #000000;
}

[data-theme="light"] .bl-context-menu-list .bl-action-item + .bl-action-item {
    border-top-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .bl-context-menu-list .bl-action-item i,
[data-theme="light"] .bl-arrow-marker {
    color: rgba(0, 0, 0, 0.88);
}

[data-theme="light"] .bl-home-featured .bl-search-result__options,
[data-theme="light"] .bl-global-search .bl-search-result__options,
[data-theme="light"] .bl-mixes .bl-search-result__options {
    color: rgba(29, 29, 31, 0.42) !important;
}

[data-theme="light"] .bl-home-featured .bl-search-result__options:hover,
[data-theme="light"] .bl-global-search .bl-search-result__options:hover,
[data-theme="light"] .bl-mixes .bl-search-result__options:hover {
    color: #1d1d1f !important;
}

/* --- Búsqueda global (solo dropdown; NO home featured) --- */
[data-theme="light"] .bl-global-search .bl-search-result:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .bl-global-search .bl-search-result.now-playing {
    background: rgba(0, 0, 0, 0.04);
}

/* --- Home Featured: sin fondo hover / now-playing (Apple track-lockup) --- */
.bl-home-featured-item.bl-search-result:hover,
.bl-home-featured-item.bl-search-result.now-playing,
[data-theme="light"] .bl-home-featured-item.bl-search-result:hover,
[data-theme="light"] .bl-home-featured-item.bl-search-result.now-playing {
    background: transparent !important;
}

/* --- Sin sombra roja en preview activo --- */
.dj-container #dj-remix-table .remix-row.now-playing:not(.is-paused) .dj-preview-container,
.dj-container #dj-remix-table .remix-row:hover .dj-preview-container,
.remix-grid-wrapper .remix-row.now-playing:not(.paused) .dj-preview-container,
.single-remix-system .remix-row.now-playing:not(.is-paused) .dj-preview-container,
.Related-version-table #dj-remix-table .remix-row.now-playing:not(.is-paused) .dj-preview-container {
    box-shadow: var(--bl-art-shadow) !important;
}

[data-theme="light"] .bl-search-result__play {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .bl-global-search .bl-search-result .bl-mixes-row__play {
    --bl-featured-photo-bg: #e6e6ea;
    background: var(--bl-featured-photo-bg, #e6e6ea) !important;
}

[data-theme="light"] .bl-search-result__play .dj-play-overlay {
    background: rgba(0, 0, 0, 0.28);
}

/* --- Home featured --- */
[data-theme="light"] .bl-home-featured__title-link {
    color: var(--bl-text);
}

[data-theme="light"] .bl-home-featured__arrow {
    color: var(--bl-text);
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .bl-home-featured-item:hover {
    background: transparent !important;
}

[data-theme="light"] .bl-home-featured-item,
[data-theme="light"] .bl-home-featured-item__play,
[data-theme="light"] .bl-home-featured-item__play:hover,
[data-theme="light"] .bl-home-featured-item__play:focus-visible {
    /* Foto de perfil DJ (transparente) → gris suave en claro */
    --bl-featured-photo-bg: #e6e6ea;
}

[data-theme="light"] .bl-home-featured-item__play,
[data-theme="light"] .bl-home-featured-item__play:hover,
[data-theme="light"] .bl-home-featured-item__play:focus-visible {
    background: var(--bl-featured-photo-bg, #e6e6ea) !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

[data-theme="light"] .bl-home-featured-item__art,
[data-theme="light"] .bl-home-featured-item__art--placeholder {
    background: var(--bl-featured-photo-bg, #e6e6ea) !important;
}

/* --- Grids audio / video — ver tables-theme.css --- */

/* --- DJ catalog --- */
[data-theme="light"] .dj-container {
    --bl-white: #1d1d1f;
    --bl-background: var(--bl-bg);
    --bl-surface: rgba(0, 0, 0, 0.03);
    --bl-surface-hover: rgba(0, 0, 0, 0.05);
    --bl-border: rgba(0, 0, 0, 0.08);
    --bl-border-hover: rgba(0, 0, 0, 0.14);
    --bl-muted: rgba(29, 29, 31, 0.55);
    --bl-soft: rgba(29, 29, 31, 0.72);
    color: #1d1d1f;
}

[data-theme="light"] .dj-container .dj-remix-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 245, 247, 0.9));
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 18px 38px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .dj-container .dj-remix-eyebrow,
[data-theme="light"] .dj-container .dj-filter-field label,
[data-theme="light"] .dj-container .dj-search-icon {
    color: rgba(29, 29, 31, 0.45) !important;
}

[data-theme="light"] .dj-container .dj-remix-heading h2,
[data-theme="light"] .dj-container #dj-remix-table,
[data-theme="light"] .dj-container #dj-remix-table .remix-title-main,
[data-theme="light"] .dj-container #dj-remix-table .cell-version-highlight,
[data-theme="light"] .dj-container .dj-search-count {
    color: #1d1d1f !important;
}

[data-theme="light"] .dj-container .dj-remix-heading p {
    color: rgba(29, 29, 31, 0.55) !important;
}

[data-theme="light"] .dj-container .dj-filters-section {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .dj-container .dj-filter-input {
    color: #1d1d1f !important;
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.10) !important;
}

[data-theme="light"] .dj-container .dj-filter-input::placeholder {
    color: rgba(29, 29, 31, 0.38) !important;
}

[data-theme="light"] .dj-container .dj-filter-input:focus {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.16) !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .dj-container .dj-filter-input option {
    color: #1d1d1f !important;
    background: #ffffff !important;
}

[data-theme="light"] .dj-container .dj-reset-btn {
    color: rgba(29, 29, 31, 0.68) !important;
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.10) !important;
}

[data-theme="light"] .dj-container .dj-reset-btn:hover {
    color: #1d1d1f !important;
    background: rgba(0, 0, 0, 0.07) !important;
    border-color: rgba(0, 0, 0, 0.14) !important;
}

[data-theme="light"] .dj-container .dj-table-shell {
    border-top-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .dj-container #dj-remix-table thead {
    background: rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .dj-container #dj-remix-table th {
    color: rgba(29, 29, 31, 0.45) !important;
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .dj-container #dj-remix-table .remix-title-artist,
[data-theme="light"] .dj-container #dj-remix-table .dj-bpm-cell,
[data-theme="light"] .dj-container #dj-remix-table .dj-genre-cell,
[data-theme="light"] .dj-container #dj-remix-table .dj-date-cell {
    color: rgba(29, 29, 31, 0.52) !important;
}

[data-theme="light"] .dj-container .bl-dj-empty-state strong {
    color: rgba(29, 29, 31, 0.82) !important;
}

[data-theme="light"] .dj-container .bl-dj-empty-state span {
    color: rgba(29, 29, 31, 0.48) !important;
}

[data-theme="light"] .dj-container .dj-pagination {
    border-top-color: rgba(0, 0, 0, 0.08) !important;
}

/* --- Single remix --- */
[data-theme="light"] .remix-hero-container-glass {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 245, 247, 0.92)) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 18px 38px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .dj-avatar-interactive,
[data-theme="light"] .dj-preview-container,
[data-theme="light"] .single-remix-system .dj-preview-container {
    background: var(--bl-art-bg) !important;
    border-color: var(--bl-border) !important;
}

[data-theme="light"] .single-remix-title,
[data-theme="light"] .single-remix-artist,
[data-theme="light"] .remix-meta-block,
[data-theme="light"] .related-versions-title,
[data-theme="light"] .rel-title-custom {
    color: rgba(29, 29, 31, 0.55) !important;
}

[data-theme="light"] .rel-title-custom span {
    color: #1d1d1f !important;
}

/* --- Shield home arrows (style.css) --- */
[data-theme="light"] .bl-home-featured .bl-home-featured__arrow {
    border-color: rgba(0, 0, 0, 0.10) !important;
    background: rgba(0, 0, 0, 0.05) !important;
    color: #1d1d1f !important;
}

[data-theme="light"] .bl-home-featured .bl-home-featured-item__play {
    border: none !important;
    border-color: transparent !important;
    background: var(--bl-art-bg) !important;
    box-shadow: none !important;
}

/* --- Skeleton gris medio en modo claro --- */
[data-theme="light"] .skeleton-play,
[data-theme="light"] .skeleton-line,
[data-theme="light"] .skeleton-pill,
[data-theme="light"] .bl-search-skeleton-play,
[data-theme="light"] .bl-search-skeleton-dots,
[data-theme="light"] .bl-search-skeleton-line,
[data-theme="light"] .dj-container .bl-dj-skeleton-line span {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.07) 0%,
        rgba(0, 0, 0, 0.14) 50%,
        rgba(0, 0, 0, 0.07) 100%
    ) !important;
    background-size: 200% 100%;
}

/* Transición suave al cambiar tema */
html[data-theme] body,
html[data-theme] .bl-sidebar,
html[data-theme] .bl-topbar,
html[data-theme] .bl-search-results {
    transition:
        background 0.28s ease,
        background-color 0.28s ease,
        color 0.28s ease,
        border-color 0.28s ease;
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme] body,
    html[data-theme] .bl-sidebar,
    html[data-theme] .bl-topbar,
    html[data-theme] .bl-search-results {
        transition: none;
    }
}
