/* =========================================================
   Vibino — Day / Night / Auto theme
   Night = the original design (untouched).
   Day   = whole page tone-inverted (html filter), media re-inverted.
   ========================================================= */

/* ---------- Day mode ---------- */
html[data-fk-theme="light"]{
  filter:invert(1) hue-rotate(180deg);
  background:#0c0a09;
  color-scheme:dark; /* native controls/scrollbars render dark, then get inverted to light */
}
html[data-fk-theme="light"] body{background-color:#0c0a09!important}
html.fk-theme-anim{transition:filter .35s ease,background-color .35s ease}

/* media keeps its real colors */
html[data-fk-theme="light"] :is(img,video,picture,canvas,iframe,embed,object,
  [style*="background-image"],.fk-home-news-bg,.fk-person-hero-bg){
  filter:invert(1) hue-rotate(180deg);
}
/* nested media inside an already re-inverted box: don't invert twice */
html[data-fk-theme="light"] :is([style*="background-image"],.fk-home-news-bg,.fk-person-hero-bg,picture,video) :is(img,video,canvas){filter:none}
/* logos / brand marks are made for dark backgrounds: let them invert with the page */
html[data-fk-theme="light"] .fk-mobile-brand img,
html[data-fk-theme="light"] #fk-app-sidebar h1 img,
html[data-fk-theme="light"] .fk-brandswap img,
html[data-fk-theme="light"] footer img[src*="fave1"]{filter:none}

/* ---------- Header theme button ---------- */
.fk-theme-btn{
  position:absolute;top:14px;right:20px;z-index:7;
  width:36px;height:36px;padding:0;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:#fbbf24;cursor:pointer;
  background:linear-gradient(135deg,rgba(124,58,237,.30),rgba(213,0,249,.16));
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 6px 18px -8px rgba(124,58,237,.9),inset 0 1px 0 rgba(255,255,255,.12);
  transition:transform .2s,box-shadow .2s,background .2s;
  -webkit-tap-highlight-color:transparent;
}
.fk-theme-btn:hover{transform:translateY(-1px) scale(1.06);box-shadow:0 10px 22px -8px rgba(124,58,237,1),inset 0 1px 0 rgba(255,255,255,.18)}
.fk-theme-btn:active{transform:scale(.94)}
.fk-theme-btn svg{width:19px;height:19px;display:none}
html[data-fk-pref="dark"]  .fk-theme-btn .fk-ti-moon,
html[data-fk-pref="light"] .fk-theme-btn .fk-ti-sun,
html[data-fk-pref="auto"]  .fk-theme-btn .fk-ti-auto{display:block}
html[data-fk-pref="dark"] .fk-theme-btn{color:#c4b5fd}
html[data-fk-pref="auto"] .fk-theme-btn{color:#67e8f9}
/* Desktop: left side, right next to the account avatar (and bell when logged in) */
@media(min-width:1024px){
  .fk-theme-btn{right:auto;left:157px}
  .fk-app-header-actions.fk-has-notif ~ .fk-theme-btn{left:202px}
}
@media(max-width:1023px){
  .fk-theme-btn{right:82px;top:50%;margin-top:-17px;width:34px;height:34px}
}

/* ---------- Popup ---------- */
.fk-theme-pop{position:fixed;inset:0;z-index:2147483000;display:none;align-items:center;justify-content:center;padding:16px;direction:rtl}
.fk-theme-pop.is-open{display:flex}
.fk-theme-pop-bg{position:absolute;inset:0;background:rgba(0,0,0,.55);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);animation:fkThFade .2s ease}
.fk-theme-sheet{
  position:relative;width:100%;max-width:380px;padding:20px 18px 18px;border-radius:24px;
  background:#1c1917;color:#e7e5e4;border:1px solid rgba(255,255,255,.10);
  box-shadow:0 30px 80px -20px rgba(0,0,0,.8),0 0 0 1px rgba(124,58,237,.12);
  animation:fkThPop .25s cubic-bezier(.22,1,.36,1);
}
.fk-theme-sheet h3{margin:0 0 4px;font-size:16px;font-weight:700;color:#fff;font-family:bakhb,bakhn,sans-serif}
.fk-theme-sheet p{margin:0 0 14px;font-size:12px;color:#a8a29e}
.fk-theme-opts{display:grid;gap:9px}
.fk-theme-opt{
  display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border-radius:16px;cursor:pointer;text-align:right;
  background:rgba(255,255,255,.04);border:1.5px solid rgba(255,255,255,.08);color:inherit;font:inherit;
  transition:background .2s,border-color .2s,transform .15s;
}
.fk-theme-opt:hover{background:rgba(255,255,255,.08)}
.fk-theme-opt:active{transform:scale(.985)}
.fk-theme-opt .fk-to-ico{flex:0 0 40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.06)}
.fk-theme-opt .fk-to-ico svg{width:22px;height:22px}
.fk-theme-opt[data-v="light"] .fk-to-ico{color:#fbbf24}
.fk-theme-opt[data-v="dark"]  .fk-to-ico{color:#c4b5fd}
.fk-theme-opt[data-v="auto"]  .fk-to-ico{color:#67e8f9}
.fk-theme-opt .fk-to-txt{flex:1;min-width:0}
.fk-theme-opt .fk-to-txt b{display:block;font-size:14px;font-weight:700;color:#fff}
.fk-theme-opt .fk-to-txt small{display:block;margin-top:2px;font-size:11.5px;color:#a8a29e}
.fk-theme-opt .fk-to-check{width:22px;height:22px;border-radius:50%;border:1.5px solid rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center;color:transparent;transition:.2s}
.fk-theme-opt .fk-to-check svg{width:13px;height:13px}
.fk-theme-opt.is-active{border-color:#8b5cf6;background:linear-gradient(135deg,rgba(124,58,237,.22),rgba(213,0,249,.10))}
.fk-theme-opt.is-active .fk-to-check{background:linear-gradient(135deg,#8b5cf6,#c026d3);border-color:transparent;color:#fff}
.fk-theme-close{position:absolute;top:12px;left:12px;width:30px;height:30px;border-radius:50%;border:0;cursor:pointer;background:rgba(255,255,255,.07);color:#d6d3d1;font-size:18px;line-height:1}
.fk-theme-close:hover{background:rgba(255,255,255,.14)}
@media(max-width:640px){
  .fk-theme-pop{align-items:flex-end;padding:0}
  .fk-theme-sheet{max-width:none;border-radius:24px 24px 0 0;padding-bottom:calc(22px + env(safe-area-inset-bottom,0px));animation:fkThUp .3s cubic-bezier(.22,1,.36,1)}
}
@keyframes fkThFade{from{opacity:0}to{opacity:1}}
@keyframes fkThPop{from{opacity:0;transform:translateY(14px) scale(.96)}to{opacity:1;transform:none}}
@keyframes fkThUp{from{transform:translateY(100%)}to{transform:none}}

/* ---------- Day mode: blurred cover behind the full player ---------- */
html[data-fk-theme="light"] .fk-player-panel{
  background-image:none!important;
  background-color:rgba(14,19,22,.93)!important;
}
html[data-fk-theme="light"] .fk-player-panel::after{
  content:"";position:absolute;inset:-90px;z-index:-1;pointer-events:none;
  background:var(--fk-cover-url,none) center/cover no-repeat;
  filter:blur(70px) saturate(1.35) invert(1) hue-rotate(180deg);
  opacity:.55;transform:translateZ(0);
}
