/* TipzPop Studio theme — creator dashboard + SuperAdmin.
 *
 * Applied by adding `tz-studio` to the app root. It re-skins the legacy utility classes used inside the
 * older tabs (so they match the new look without rewriting thousands of lines) and adds light motion.
 *
 * Motion rules: transform + opacity only, one-shot entrances, no infinite loops, no backdrop-filter.
 */

.tz-studio {
  --st-canvas: #08070f;
  --st-surface: #110f1d;
  --st-elev: #181427;
  --st-line: rgba(255, 255, 255, 0.08);
  --st-grad: linear-gradient(115deg, #7c5cff 0%, #ff4fd8 100%);
  background: var(--st-canvas);
  scrollbar-width: thin;
  scrollbar-color: #2b2543 transparent;
}
.tz-studio ::selection { background: rgba(124, 92, 255, 0.45); color: #fff; }

/* ---------- palette remap for legacy classes ---------- */
.tz-studio [class*="bg-[#09090b]"], .tz-studio [class*="bg-[#0A0A0B]"], .tz-studio [class*="bg-[#07060d]"], .tz-studio [class*="bg-[#08080a]"] { background-color: var(--st-canvas); }
.tz-studio [class*="bg-[#111114]"], .tz-studio [class*="bg-[#121215]"], .tz-studio [class*="bg-[#0f0c1d]"], .tz-studio [class*="bg-[#0c0d14]"],
.tz-studio [class*="bg-slate-900"] { background-color: var(--st-surface); }
.tz-studio [class*="bg-[#1A1A1E]"], .tz-studio [class*="bg-[#16122e]"], .tz-studio [class*="bg-slate-950"] { background-color: var(--st-elev); }
.tz-studio [class*="border-white/[0.08]"] { border-color: var(--st-line); }

.tz-studio input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="hidden"]),
.tz-studio textarea, .tz-studio select {
  background-color: var(--st-elev);
  border-color: rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.tz-studio input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):focus,
.tz-studio textarea:focus, .tz-studio select:focus {
  outline: none; border-color: #9d86ff; box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.22);
}
.tz-studio input[type="range"] { accent-color: #ff4fd8; }
.tz-studio input[type="checkbox"], .tz-studio input[type="radio"] { accent-color: #7c5cff; }

.tz-studio button, .tz-studio a { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.15s ease; }
.tz-studio button:not(:disabled):active { transform: scale(0.97); }
.tz-studio table tbody tr { transition: background-color 0.15s ease; }
.tz-studio table tbody tr:hover { background-color: rgba(255, 255, 255, 0.025); }

/* ---------- navigation ---------- */
.tz-nav-on { background: linear-gradient(135deg, rgba(124, 92, 255, 0.32), rgba(255, 79, 216, 0.18)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09); }
.tz-nav-bar { background: var(--st-grad); }
.tz-navbtn { transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.tz-navbtn:hover { transform: translateX(2px); }

/* ---------- surfaces ---------- */
.tz-kpi { position: relative; overflow: hidden; transition: border-color 0.25s ease, transform 0.25s ease; }
.tz-kpi::after { content: ''; position: absolute; right: -42px; bottom: -64px; width: 170px; height: 170px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(124, 92, 255, 0.2), transparent); }
.tz-kpi:hover { border-color: rgba(157, 134, 255, 0.4); transform: translateY(-2px); }
.tz-panel { transition: border-color 0.25s ease; }
.tz-panel:hover { border-color: rgba(255, 255, 255, 0.14); }

/* ---------- chart ---------- */
.tz-bar { background: linear-gradient(180deg, #ff4fd8, #7c5cff); transform-origin: bottom; animation: stGrow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 28ms); }
.tz-bar-0 { background: rgba(255, 255, 255, 0.07); }
.tz-fill { transform-origin: left; animation: stFill 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* ---------- motion ---------- */
@keyframes stRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes stFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes stToast { from { opacity: 0; transform: translate(-50%, -14px) scale(0.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes stFade { from { opacity: 0; } to { opacity: 1; } }

/* a tab/page mounts => its blocks rise in one after another */
.tz-studio .tz-main > * { animation: stFade 0.25s ease both; }
.tz-studio .tz-main > * > * { animation: stRise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.tz-studio .tz-main > * > *:nth-child(1) { animation-delay: 0.02s; }
.tz-studio .tz-main > * > *:nth-child(2) { animation-delay: 0.07s; }
.tz-studio .tz-main > * > *:nth-child(3) { animation-delay: 0.12s; }
.tz-studio .tz-main > * > *:nth-child(4) { animation-delay: 0.17s; }
.tz-studio .tz-main > * > *:nth-child(5) { animation-delay: 0.22s; }
.tz-studio .tz-main > * > *:nth-child(6) { animation-delay: 0.27s; }
.tz-studio .tz-main > * > *:nth-child(n+7) { animation-delay: 0.32s; }
.tz-stagger > * { animation: stRise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.tz-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.tz-stagger > *:nth-child(2) { animation-delay: 0.11s; }
.tz-stagger > *:nth-child(3) { animation-delay: 0.17s; }
.tz-stagger > *:nth-child(4) { animation-delay: 0.23s; }
.tz-toast-in { animation: stToast 0.35s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.tz-pop-in { animation: stRise 0.35s cubic-bezier(0.2, 0.9, 0.3, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .tz-studio .tz-main > *, .tz-studio .tz-main > * > *, .tz-stagger > *, .tz-bar, .tz-fill, .tz-toast-in, .tz-pop-in { animation: none !important; }
  .tz-navbtn:hover, .tz-kpi:hover { transform: none; }
}

/* ---------- Creator Studio polish (class tz-creator; the admin console is untouched) ----------
 * One rhythm: 24px between blocks, equal left and right edges, one card radius, quiet borders. Cards lift 2px on
 * hover only when they are links; buttons step on hover and press on click. Nothing here hides or removes anything. */
.tz-creator .tz-main { scroll-margin-top: 80px; }
.tz-creator section.tz-panel, .tz-creator .tz-panel { border-radius: 18px; }
.tz-creator .tz-panel h2 { letter-spacing: -0.005em; }
.tz-creator .tz-panel p { text-wrap: pretty; }
.tz-creator a.tz-panel:hover, .tz-creator button.tz-panel:hover { transform: translateY(-2px); }

/* the three OBS pages share one bar that stays in view under the header */
.tz-creator .tz-streambar { position: sticky; top: 64px; z-index: 20; background: #0f0d1a; box-shadow: 0 -12px 0 0 #07060d, 0 12px 0 -2px #07060d; -webkit-overflow-scrolling: touch; }

/* the Save bar at the bottom floats over a soft fade, so the card behind it never shows through the text */
.tz-creator .sticky.bottom-4 { padding-top: 14px; background: linear-gradient(180deg, rgba(7, 6, 13, 0) 0%, rgba(7, 6, 13, 0.92) 55%); }

/* phones: the header keeps the page name readable, cards use the width, tap targets stay 44px */
@media (max-width: 639px) {
  .tz-creator header h1 { font-size: 1.05rem; }
  .tz-creator .tz-panel { padding: 16px; }
  .tz-creator .tz-main { padding-left: 14px; padding-right: 14px; }
  .tz-creator .tz-streambar button { min-width: max-content; }
}
@media (prefers-reduced-motion: reduce) { .tz-creator a.tz-panel:hover, .tz-creator button.tz-panel:hover { transform: none; } }

/* the section switcher of the Tip page sticks under the header on a solid ground, so cards never show through it */
.tz-creator .sticky.top-20 { top: 64px; padding: 8px 4px; background: #07060d; box-shadow: 0 10px 12px -8px #07060d; z-index: 20; }
