/* ==========================================================================
   Eclipsed Player — design festiv (Modul 9)
   Variante: Christmas Dark, Christmas Light, iar pe celelalte teme culorile vin din tokenii theme.css.
   ========================================================================== */
#christmasPlayer { display: none !important; }   /* playerul vechi: înlocuit de .fxp (logica lui rămâne neatinsă) */

.fxp {
  --p-bg: var(--glass); --p-fg: var(--text); --p-muted: var(--muted); --p-line: var(--theme-border);
  --p-accent: var(--theme-accent); --p-accent-2: var(--theme-accent-2); --p-hi: var(--theme-highlight); --p-soft: var(--theme-soft); --p-field: var(--surface-2);
  position: fixed; z-index: 70; left: 20px; bottom: 20px; width: 300px; max-width: calc(100vw - 24px);
  border: 1px solid var(--p-line); border-radius: 20px; color: var(--p-fg); background: var(--p-bg);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .03) inset;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: width .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease, border-color .3s ease;
  animation: fxpIn .7s cubic-bezier(.2, .9, .3, 1.1) both;
}
.fxp[hidden] { display: none; }
.fxp.is-open { width: 356px; }
.fxp.is-playing { box-shadow: 0 18px 50px rgba(0, 0, 0, .42), 0 0 34px var(--p-soft); }
@keyframes fxpIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Christmas ---------- */
body[data-theme="christmas"] .fxp {
  --p-bg: linear-gradient(150deg, rgba(12, 42, 30, .96), rgba(24, 18, 28, .97) 58%, rgba(52, 14, 24, .96));
  --p-fg: #fff4d9; --p-muted: #cbbf9e; --p-line: rgba(226, 190, 96, .55); --p-accent: #e0b950; --p-accent-2: #d4374a; --p-hi: #ffd978; --p-soft: rgba(224, 185, 80, .32); --p-field: rgba(255, 244, 217, .08);
  border-image: none; box-shadow: 0 16px 44px rgba(0, 0, 0, .5), 0 0 28px rgba(224, 185, 80, .16);
}
html[data-mode="light"] body[data-theme="christmas"] .fxp {
  --p-bg: linear-gradient(150deg, rgba(255, 252, 244, .97), rgba(246, 238, 221, .97) 58%, rgba(253, 234, 232, .97));
  --p-fg: #20382b; --p-muted: #66705f; --p-line: rgba(168, 128, 38, .5); --p-accent: #b8902f; --p-accent-2: #c0283a; --p-hi: #9a6f12; --p-soft: rgba(184, 144, 47, .26); --p-field: rgba(32, 56, 43, .07);
  box-shadow: 0 14px 38px rgba(60, 40, 20, .22), 0 0 24px rgba(184, 144, 47, .14);
}
/* bandă festivă: becuri pe marginea de sus (doar Crăciun) */
.fxp-lights { display: none; }
body[data-theme="christmas"] .fxp-lights { display: flex; position: absolute; left: 22px; right: 22px; top: -5px; justify-content: space-between; pointer-events: none; }
.fxp-lights i { width: 7px; height: 10px; border-radius: 50% 50% 48% 48% / 38% 38% 62% 62%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--c, #ffd25a) 38%, color-mix(in srgb, var(--c, #ffd25a) 55%, #000)); box-shadow: 0 0 9px var(--c, #ffd25a); animation: fxpTw 2.4s ease-in-out var(--d, 0s) infinite alternate; }
.fxp-lights i:nth-child(5n+1) { --c: #ff4a5a; } .fxp-lights i:nth-child(5n+2) { --c: #ffd25a; --d: -.6s; } .fxp-lights i:nth-child(5n+3) { --c: #4ee08c; --d: -1.2s; } .fxp-lights i:nth-child(5n+4) { --c: #5ab4ff; --d: -1.8s; } .fxp-lights i:nth-child(5n) { --c: #ff8fd0; --d: -.3s; }
.fxp-lights i:nth-child(odd) { transform: translateY(2px); }
@keyframes fxpTw { from { opacity: .5; } to { opacity: 1; } }
body[data-theme="christmas"] .fxp::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; background: conic-gradient(from var(--a, 0deg), #e0b950, #d4374a, #2f8f5f, #e0b950, #d4374a, #2f8f5f, #e0b950); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); opacity: .75; animation: fxpSpin 14s linear infinite; }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes fxpSpin { to { --a: 360deg; } }

/* ---------- Antet compact ---------- */
.fxp-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; }
.fxp-cover { position: relative; display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 1.5px solid var(--p-accent); background: radial-gradient(circle at 30% 25%, var(--p-accent-2), color-mix(in srgb, var(--p-accent-2) 40%, #000) 70%); box-shadow: 0 0 0 3px var(--p-soft), 0 4px 12px rgba(0, 0, 0, .35); transition: width .35s cubic-bezier(.2, .8, .2, 1), height .35s cubic-bezier(.2, .8, .2, 1), border-radius .35s ease; }
.fxp-cover b { font-size: 18px; color: #fff4d9; text-shadow: 0 0 10px rgba(255, 220, 130, .8); }
.fxp-cover.has-img { background: var(--img) center / cover no-repeat; } .fxp-cover.has-img b { display: none; }
.fxp-cover::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: var(--p-bg-dot, rgba(10, 14, 12, .85)); border: 1.5px solid var(--p-accent); opacity: 0; transition: opacity .3s ease; }
.fxp.is-playing .fxp-cover:not(.is-open) { animation: fxpSpinCover 9s linear infinite; }
.fxp.is-playing .fxp-cover::after { opacity: 1; }
@keyframes fxpSpinCover { to { rotate: 360deg; } }
.fxp-meta { min-width: 0; cursor: pointer; display: grid; line-height: 1.25; }
.fxp-title { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.fxp-artist { overflow: hidden; color: var(--p-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.fxp.is-swapping .fxp-meta { animation: fxpSwapText .5s cubic-bezier(.2, .8, .2, 1); }
.fxp.is-swapping .fxp-cover { animation: fxpSwapCover .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes fxpSwapText { 0% { opacity: 0; transform: translateX(12px); } 100% { opacity: 1; transform: none; } }
@keyframes fxpSwapCover { 0% { opacity: .2; scale: .8; } 60% { scale: 1.06; } 100% { opacity: 1; scale: 1; } }

/* indicator de redare (egalizator) */
.fxp-eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 16px; height: 16px; opacity: .35; transition: opacity .3s ease; }
.fxp-eq i { flex: 1; height: 30%; border-radius: 2px; background: var(--p-hi); transform-origin: 50% 100%; }
.fxp.is-playing .fxp-head .fxp-eq { opacity: 1; }
.fxp.is-playing .fxp-eq i { animation: fxpEq .9s ease-in-out infinite alternate; }
.fxp-eq i:nth-child(2) { animation-delay: -.3s !important; } .fxp-eq i:nth-child(3) { animation-delay: -.6s !important; } .fxp-eq i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes fxpEq { from { height: 25%; } to { height: 100%; } }

/* ---------- Butoane ---------- */
.fxp-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--p-fg); cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .18s ease, box-shadow .25s ease; }
.fxp-btn svg { width: 17px; height: 17px; pointer-events: none; }
.fxp-btn:hover { background: var(--p-field); color: var(--p-hi); border-color: var(--p-line); transform: translateY(-1px); }
.fxp-btn:active { transform: scale(.9); }
.fxp-btn:focus-visible, .fxp-cta:focus-visible, .fxp-row:focus-visible { outline: 2px solid var(--p-hi); outline-offset: 2px; }
.fxp-head-play { width: 38px; height: 38px; border-color: var(--p-accent); background: linear-gradient(135deg, var(--p-accent-2), color-mix(in srgb, var(--p-accent-2) 60%, #000)); color: #fff; box-shadow: 0 4px 14px var(--p-soft); }
.fxp-head-play:hover { background: linear-gradient(135deg, var(--p-accent-2), var(--p-accent-2)); color: #fff; box-shadow: 0 6px 20px var(--p-soft); }
.fxp-toggle svg { transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.fxp.is-open .fxp-toggle svg { transform: rotate(180deg); }

/* ---------- Panou extins ---------- */
.fxp-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s cubic-bezier(.2, .8, .2, 1); }
.fxp.is-open .fxp-panel { grid-template-rows: 1fr; }
.fxp-panel-in { min-height: 0; overflow: hidden; padding: 0 14px; opacity: 0; transition: opacity .3s ease, padding .4s ease; }
.fxp.is-open .fxp-panel-in { padding: 2px 14px 14px; opacity: 1; }
.fxp.is-open .fxp-head-play { display: none; }
.fxp.is-open .fxp-head { grid-template-columns: auto minmax(0, 1fr) auto auto; padding-bottom: 6px; }
.fxp.is-open .fxp-cover { width: 62px; height: 62px; border-radius: 16px; }
.fxp.is-open .fxp-cover::after { display: none; }
.fxp.is-open.is-playing .fxp-cover { animation: fxpPulse 3.2s ease-in-out infinite; }
@keyframes fxpPulse { 0%, 100% { box-shadow: 0 0 0 3px var(--p-soft), 0 4px 14px rgba(0, 0, 0, .35); scale: 1; } 50% { box-shadow: 0 0 0 6px var(--p-soft), 0 6px 22px rgba(0, 0, 0, .4); scale: 1.035; } }
.fxp.is-open .fxp-title { font-size: 14.5px; }
.fxp-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; margin: 8px 0 6px; color: var(--p-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.fxp-transport { display: flex; align-items: center; gap: 6px; }
.fxp-play { width: 46px; height: 46px; border-color: var(--p-accent); background: linear-gradient(135deg, var(--p-accent-2), color-mix(in srgb, var(--p-accent-2) 60%, #000)); color: #fff; box-shadow: 0 5px 18px var(--p-soft); }
.fxp-play svg { width: 20px; height: 20px; }
.fxp-play:hover { background: var(--p-accent-2); color: #fff; box-shadow: 0 8px 26px var(--p-soft); }
.fxp-vol { display: flex; align-items: center; gap: 2px; margin-left: auto; min-width: 0; }
.fxp-list-toggle.on { background: var(--p-soft); border-color: var(--p-accent); color: var(--p-hi); }

/* range-uri */
.fxp input[type="range"] { -webkit-appearance: none; appearance: none; height: 16px; margin: 0; background: transparent; cursor: pointer; --p: 0%; }
.fxp input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--p-accent), var(--p-accent-2)) 0 0 / var(--p) 100% no-repeat, var(--p-field); }
.fxp input[type="range"]::-moz-range-track { height: 5px; border-radius: 5px; background: var(--p-field); }
.fxp input[type="range"]::-moz-range-progress { height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--p-accent), var(--p-accent-2)); }
.fxp input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4px; border: 2px solid var(--p-accent); border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .4); transition: transform .15s ease; }
.fxp input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--p-accent); border-radius: 50%; background: #fff; }
.fxp input[type="range"]:hover::-webkit-slider-thumb, .fxp input[type="range"]:focus-visible::-webkit-slider-thumb { transform: scale(1.25); }
.fxp input[type="range"]:focus-visible { outline: 2px solid var(--p-hi); outline-offset: 3px; border-radius: 6px; }
.fxp input[type="range"]:disabled { opacity: .45; cursor: default; }
.fxp-volume { width: 64px; }

/* ---------- Playlist ---------- */
.fxp-list { display: grid; gap: 2px; max-height: 188px; margin: 10px 0 0; padding: 4px 0 0; overflow-y: auto; list-style: none; border-top: 1px solid var(--p-line); scrollbar-width: thin; scrollbar-color: var(--p-accent) transparent; }
.fxp-list[hidden] { display: none; }
.fxp-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.fxp-row:hover { background: var(--p-field); transform: translateX(2px); }
.fxp-row.is-current { background: var(--p-soft); }
.fxp-row.is-failed { opacity: .5; }
.fxp-num { position: relative; display: grid; place-items: center; height: 18px; color: var(--p-muted); font-size: 11px; font-style: normal; }
.fxp-num em { font-style: normal; } .fxp-num .fxp-eq { position: absolute; inset: 0; margin: auto; width: 13px; height: 13px; opacity: 0; }
.fxp-row.is-current .fxp-num em { opacity: 0; } .fxp-row.is-current .fxp-num .fxp-eq { opacity: 1; }
.fxp:not(.is-playing) .fxp-num .fxp-eq i { animation: none; height: 55%; }
.fxp-rtext { display: grid; min-width: 0; line-height: 1.25; } .fxp-rtext b { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.fxp-rtext small { overflow: hidden; color: var(--p-muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.fxp-row.is-current .fxp-rtext b { color: var(--p-hi); }
.fxp-rdur { color: var(--p-muted); font-size: 11px; font-variant-numeric: tabular-nums; }

/* ---------- Stări: gol, notificare, autoplay blocat ---------- */
.fxp-empty { display: grid; justify-items: center; gap: 6px; padding: 14px 8px 4px; text-align: center; }
.fxp-empty[hidden], .fxp-main[hidden], .fxp-note[hidden], .fxp-cta[hidden] { display: none; }
.fxp-empty svg { width: 34px; height: 34px; color: var(--p-hi); opacity: .85; animation: fxpFloat 3.5s ease-in-out infinite; }
.fxp-empty b { font-size: 13.5px; } .fxp-empty small { max-width: 240px; color: var(--p-muted); font-size: 11.5px; line-height: 1.45; }
@keyframes fxpFloat { 50% { transform: translateY(-4px) rotate(-4deg); } }
.fxp.is-empty .fxp-head-play, .fxp.is-empty .fxp-eq { display: none; }
.fxp.is-empty .fxp-head { grid-template-columns: auto minmax(0, 1fr) auto; }
.fxp-note { margin: 10px 0 0; padding: 8px 10px; border: 1px solid var(--p-line); border-radius: 10px; background: var(--p-field); color: var(--p-muted); font-size: 11.5px; line-height: 1.4; animation: fxpIn .35s ease both; }
.fxp-cta { position: absolute; left: 0; bottom: calc(100% + 10px); display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border: 1px solid var(--p-accent); border-radius: 999px; background: linear-gradient(135deg, var(--p-accent-2), color-mix(in srgb, var(--p-accent-2) 60%, #000)); color: #fff; font: 800 12px Inter, Arial, sans-serif; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .4), 0 0 0 0 var(--p-soft); animation: fxpIn .5s ease both, fxpCta 2.4s ease-in-out .6s infinite; transition: transform .2s ease, filter .2s ease; }
.fxp-cta svg { width: 15px; height: 15px; }
.fxp-cta:hover { transform: translateY(-2px); filter: brightness(1.12); } .fxp-cta:active { transform: scale(.96); }
@keyframes fxpCta { 0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, .4), 0 0 0 0 var(--p-soft); } 50% { box-shadow: 0 8px 24px rgba(0, 0, 0, .4), 0 0 0 9px transparent; } }
.fxp.is-blocked .fxp-head-play { animation: fxpCta 2.4s ease-in-out infinite; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .fxp, .fxp.is-open { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; }
  .fxp-head { padding: 9px 8px 9px 10px; }
  .fxp-btn { width: 42px; height: 42px; } .fxp-head-play { width: 44px; height: 44px; } .fxp-play { width: 52px; height: 52px; }
  .fxp-btn svg { width: 19px; height: 19px; }
  .fxp-panel-in { max-height: min(62vh, 440px); overflow-y: auto; }
  .fxp-volume { width: 56px; } .fxp-vol { margin-left: 0; }
  .fxp-transport { flex-wrap: wrap; row-gap: 6px; }
  .fxp-list { max-height: 150px; }
  .fxp input[type="range"] { height: 26px; }
  body.has-fxp .toast { bottom: 84px; right: 10px; left: 10px; max-width: none; }
  .fxp-cta { left: 0; right: 0; justify-content: center; }
}
@media (max-width: 380px) { .fxp-vol .fxp-volume { display: none; } }

/* ---------- Mișcare redusă / FX Lite ---------- */
@media (prefers-reduced-motion: reduce) {
  .fxp, .fxp *, .fxp::before { animation: none !important; transition-duration: .01s !important; }
}
html[data-fx="lite"] .fxp::before, html[data-fx="lite"] .fxp-lights i, html[data-fx="lite"] .fxp-cover, html[data-fx="lite"] .fxp-empty svg { animation: none !important; }
