﻿:root {
  --bg-primary: #111214;
  --bg-secondary: #121315;
  --bg-card: #15161a;
  --bg-card-hover: #1c1d22;
  --bg-hover: #1c1d22;
  --bg-input: #15161a;
  --bg-popup: #121315;
  --border: #222228;
  --border-strong: #2a2a32;
}
/* ================================================================
   QuickBar Pro — Text / Expression Tab
   Expression library, categories, detail panel, preview
   ================================================================ */

/* ── LAYOUT ────────────────────────────────────────────────────── */
.lib-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.sidebar {
  width: 140px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 6px;
}

.cat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}
.cat:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.cat.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 700;
}

.cat-count {
  margin-left: auto;
  font-size: 7px;
  color: var(--text-dim);
  font-weight: 600;
}

.split-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.split-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

/* ── EXPRESSION CARDS ──────────────────────────────────────────── */
.exp-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 4px;
}
.exp-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.exp-card.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.exp-card-name {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-card-desc {
  font-size: 7px;
  color: var(--text-dim);
}

/* ── DETAIL PANEL ──────────────────────────────────────────────── */
.detail-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.detail-modal-overlay.active { display: flex; }

.detail-modal-content {
  background: var(--bg-popup);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 16px;
  box-shadow: var(--shadow-lg);
}

.detail-preview {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 80px;
  margin-bottom: 12px;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-params {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-param-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-param-row label {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 80px;
}
.detail-param-slider {
  flex: 1;
  height: 3px;
  accent-color: var(--accent);
}
.detail-param-value {
  font-size: 8px;
  font-weight: 700;
  color: var(--accent);
  min-width: 30px;
  text-align: right;
}

.detail-btn {
  padding: 6px 14px;
  font-size: 9px;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: 0.3px;
}
.detail-btn-apply {
  background: var(--accent);
  color: var(--accent-text);
}
.detail-btn-apply:hover { background: var(--accent-hover); }
.detail-btn-bake {
  background: rgba(245,158,11,0.12);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.2);
}
.detail-btn-bake:hover {
  background: rgba(245,158,11,0.2);
}

/* ── SEGMENTED CONTROLS ────────────────────────────────────────── */
.segmented-control {
  display: flex;
  background: var(--bg-input);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.seg-btn {
  flex: 1;
  padding: 4px 8px;
  font-size: 8px;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.seg-btn:hover {
  color: var(--text-primary);
}
.seg-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}

/* ── UNIFIED CATEGORIES (Single Theme Color) ──────────────────── */
.cat {
  color: var(--text-muted, #9a9aa6) !important;
  background: #1b1b20 !important;
  border: 1px solid #26262f !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-size: 9.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  transition: all 0.15s !important;
}
.cat:hover {
  background: #26262e !important;
  color: #ffffff !important;
  border-color: #33333d !important;
}
.cat.active {
  background: var(--accent, #1473e6) !important;
  color: #ffffff !important;
  border-color: var(--accent, #1473e6) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35) !important;
}
.cat svg {
  color: inherit !important;
}

#customAnimationsContainer { background: radial-gradient(circle at 50% 0,rgba(96,165,250,.08),transparent 45%),var(--bg-primary); }
#customSubTabs { display:flex; align-items:center; gap:4px; padding:6px; background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.08); border-radius:10px; flex-shrink:0; }
.ca-subtab,.ca-mode-btn { padding:5px 8px; border:1px solid transparent; border-radius:6px; font-size:8px; font-weight:800; color:var(--text-dim); cursor:pointer; user-select:none; transition:all .15s; }
.ca-subtab:hover,.ca-mode-btn:hover { color:var(--text-primary); background:rgba(255,255,255,.06); }
.ca-subtab.active,.ca-mode-btn.active { color:var(--accent-text); background:var(--accent); border-color:var(--accent); }
#customTextFilters,#customShapeFilters { display:flex; align-items:center; gap:4px; padding:2px 0; flex-shrink:0; }
.ca-grpchip { padding:4px 8px; border:1px solid transparent; border-radius:7px; font-size:8px; font-weight:700; color:var(--text-dim); background:rgba(255,255,255,.03); cursor:pointer; user-select:none; transition:all .15s; }
.ca-grpchip:hover { color:var(--text-primary); background:rgba(255,255,255,.06); }
.ca-grpchip.active { color:var(--accent); border-color:rgba(96,165,250,.35); background:rgba(96,165,250,.12); }
.ca-bounce-toggle { display:inline-flex; align-items:center; gap:5px; margin-left:auto; color:var(--text-muted); font-size:8px; font-weight:700; cursor:pointer; }
.ca-bounce-toggle input { accent-color:var(--accent); }
#caPreviewStage { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:180px; max-height:220px; padding:10px; overflow:hidden; background:linear-gradient(145deg,rgba(255,255,255,.055),rgba(255,255,255,.01)); border:1px solid rgba(255,255,255,.08); border-radius:10px; flex-shrink:0; }
.ca-pv-idle { font-size:9px; color:var(--text-dim); letter-spacing:.3px; }
#caGallery { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) !important; gap:6px; overflow-y:auto; min-height:0; padding:2px; }
.ca-tile { position:relative; min-height:62px; padding:5px 3px; border:1px solid rgba(255,255,255,.08); border-radius:8px; background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.015)); cursor:pointer; overflow:hidden; transition:transform .15s,border-color .15s,box-shadow .15s; }
.ca-tile:hover { transform:translateY(-2px); border-color:var(--accent); box-shadow:0 8px 18px rgba(0,0,0,.22),0 0 12px var(--accent-glow); }
.ca-tile-prev { display:flex; align-items:center; justify-content:center; min-height:45px; padding:5px; }
.ca-tile-prev svg { width:100%; height:auto; max-height:34px; }
.ca-tile-name { position:absolute; left:0; right:0; bottom:0; padding:3px; background:linear-gradient(transparent,rgba(0,0,0,.8)); color:var(--text-muted); font-size:6.5px; font-weight:700; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ca-pv-row { display:flex; justify-content:center; margin-bottom:2px; }
.ca-ch { display:inline-flex; align-items:center; justify-content:center; width:22px; height:26px; color:var(--accent); font-size:18px; font-weight:800; animation-duration:.85s; animation-iteration-count:infinite; animation-fill-mode:both; animation-name:var(--ca-anim,none); animation-timing-function:var(--ca-ease,cubic-bezier(.2,.85,.25,1)); animation-delay:var(--ca-d,0s); }
.ca-ch.ca-sp { animation:none; width:auto; }
.ca-shape-pv { animation-duration:1.2s; animation-iteration-count:infinite; animation-fill-mode:both; animation-name:var(--ca-anim,none); animation-timing-function:var(--ca-ease,cubic-bezier(.2,.85,.25,1)); }
#caGallery::-webkit-scrollbar { width:4px; }
#caGallery::-webkit-scrollbar-thumb { background:rgba(255,255,255,.12); border-radius:4px; }
@keyframes ca-pv-su { 0%{transform:translateY(32px);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-sd { 0%{transform:translateY(-32px);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-sl { 0%{transform:translateX(40px);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-sr { 0%{transform:translateX(-40px);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-pop { 0%{transform:scale(0);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-scaledn { 0%{transform:scale(1.5);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-scalex { 0%{transform:scaleX(0);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-scaley { 0%{transform:scaleY(0);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-rot { 0%{transform:rotate(45deg);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-risescale { 0%{transform:translateY(28px) scale(.5);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-flipx { 0%{transform:rotateX(80deg);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-flipy { 0%{transform:rotateY(80deg);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-flipxy { 0%{transform:rotateX(60deg) rotateY(60deg);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-fade { 0%{opacity:0} 100%{opacity:1} }
@keyframes ca-pv-blur { 0%{filter:blur(12px);opacity:0} 100%{filter:none;opacity:1} }
@keyframes ca-pv-fadedim { 0%{opacity:.25} 100%{opacity:1} }
@keyframes ca-pv-scale { 0%{transform:scale(0);opacity:0} 100%{transform:none;opacity:1} }
@keyframes ca-pv-down { 0%{transform:translateY(-80px)} 100%{transform:none} }
@keyframes ca-pv-up { 0%{transform:translateY(80px)} 100%{transform:none} }
@keyframes ca-pv-left { 0%{transform:translateX(80px)} 100%{transform:none} }
@keyframes ca-pv-right { 0%{transform:translateX(-80px)} 100%{transform:none} }


/* ── OVERRIDES FOR QUICKBAR AE UNIFIED DARK DESIGN ─────────────── */
/* #panel-text_ani is now a direct flex-column container (no wrapper divs) */
#panel-text_ani {
  padding: 0 !important;
  background: var(--bg-primary, #131316) !important;
}

#panel-text_ani.panel-active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* Category chips sidebar (horizontal row at top of tab) */
#text-ani-sidebar {
  width: 100% !important;
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  padding: 6px !important;
  margin: 0 !important;
  background: var(--bg-secondary, #131316) !important;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08)) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

#text-ani-sidebar::-webkit-scrollbar {
  display: none !important;
}

.split-panel {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
  background: var(--bg-primary, #131316) !important;
  position: relative !important;
}

.split-list {
  flex: 1 !important;
  width: 100% !important;
  overflow-y: auto !important;
  background: var(--bg-primary, #131316) !important;
}

#customAnimationsContainer {
  flex: 1 !important;
  background: var(--bg-primary, #131316) !important;
}


/* ==========================================================================
   GLOBAL CUSTOM SCROLLBARS (Modern Dark UI Blended for Windows CEP)
   Applies to all scrollable tabs, containers, modals, textareas & elements
   ========================================================================== */

/* Standard W3C Scrollbar (Firefox / Modern CEP) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

/* WebKit Scrollbar Track & Thumb (Chromium / Windows CEP / Edge / Safari) */
::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 4px !important;
  height: 4px !important;
}

::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: transparent !important;
  border-radius: 4px !important;
}

::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16) !important;
  border-radius: 4px !important;
  transition: background 0.15s ease !important;
}

::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35) !important;
}

::-webkit-scrollbar-thumb:active,
*::-webkit-scrollbar-thumb:active {
  background: var(--accent, #1473e6) !important;
}

::-webkit-scrollbar-corner,
*::-webkit-scrollbar-corner {
  background: transparent !important;
}

/* Remove default white arrow buttons on Windows Chromium CEP */
::-webkit-scrollbar-button,
*::-webkit-scrollbar-button {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}


/* --- Enhanced Custom Shape 4-column & Detail Action Button Styles --- */
#customAnimationsContainer[data-sub="shape"] #caGallery {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.detail-prop-select {
  flex: 1;
}
.detail-target-select {
  width: 100%;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 600;
  background: #15151c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #eee;
  outline: none;
}
.detail-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.detail-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}
.detail-btn-copy {
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
}
.detail-btn-preview {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
}
.detail-btn-preview:hover {
  background: rgba(59, 130, 246, 0.28) !important;
}
.detail-btn-apply {
  background: #22c55e !important;
  color: #052e16 !important;
  border: 1px solid #16a34a !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}
.detail-btn-apply:hover {
  background: #16a34a !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(34, 197, 94, 0.4);
}
.detail-btn-bake {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  font-weight: 800 !important;
}
.detail-btn-bake:hover {
  background: rgba(245, 158, 11, 0.28) !important;
}


#caGallery {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px !important;
  padding-bottom: 24px !important;
}

@keyframes caFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.ca-tile-selected { border-color: var(--accent, #a855f7) !important; box-shadow: 0 0 12px rgba(168,85,247,0.4) !important; }
