html,
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #070708;
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

canvas {
  display: block;
}

/* Sleek Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Container */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  user-select: none;
}

/* Sidebar Tabs Strip */
#sidebar-tabs {
  width: 60px;
  background: rgba(13, 13, 16, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 24px;
  gap: 18px;
  z-index: 102;
}

.tab-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #6b7280;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover,
.tab-btn.fake-hover {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.1);
}

/* Tooltip styling */
.tab-btn .tooltip {
  position: absolute;
  left: 72px;
  top: 50%;
  transform: translateY(-50%);
  background: #0f0f11;
  color: #f3f4f6;
  font-size: 10px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn:hover .tooltip,
.tab-btn.fake-hover .tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(2px);
}

/* Sidebar Panels Drawer */
#sidebar-panels {
  width: 260px;
  background: rgba(18, 18, 22, 0.8);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, border-right-color 0.3s;
  overflow: hidden;
  z-index: 101;
}

#sidebar.collapsed #sidebar-panels {
  width: 0;
  opacity: 0;
  pointer-events: none;
  border-right-color: transparent;
}

.tab-panel {
  display: none;
  padding: 24px 20px;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  flex-direction: column;
  gap: 18px;
  min-width: 260px;
}

.tab-panel.active {
  display: flex;
}

.panel-title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

/* Interactive inputs and elements inside panels */
.tab-panel label {
  display: block;
  margin-top: 12px;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Premium Range Input Styling */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  outline: none;
  margin: 8px 0;
  transition: background 0.2s;
}

input[type=range]:hover,
input[type=range].fake-hover {
  background: rgba(255, 255, 255, 0.12);
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fbbf24;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

input[type=range]::-webkit-slider-thumb:hover,
input[type=range].fake-hover::-webkit-slider-thumb {
  transform: scale(1.25);
  background: #f59e0b;
}

input[type=range]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #fbbf24;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

input[type=range]::-moz-range-thumb:hover,
input[type=range].fake-hover::-moz-range-thumb {
  transform: scale(1.25);
  background: #f59e0b;
}

.tab-panel .val {
  float: right;
  color: #fbbf24;
  font-weight: 600;
  font-size: 11px;
}

/* Brush Grid / Buttons layout */
.brush-grid {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.tool {
  flex: 1;
  padding: 8px 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #d1d5db;
  font: 500 11px 'Inter', sans-serif;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool:hover,
.tool.fake-hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.tool.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

/* Asset list in session */
#session-assets-list {
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-asset-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  color: #d1d5db;
}

.session-asset-item:hover,
.session-asset-item.fake-hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.session-asset-item.selected {
  background: rgba(251, 191, 36, 0.06);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.session-asset-item .delete-btn {
  background: transparent;
  border: none;
  color: #f87171;
  cursor: pointer;
  padding: 0 4px;
  font-size: 12px;
  transition: color 0.2s;
}

.session-asset-item .delete-btn:hover {
  color: #ef4444;
}

/* Sidebar Toggle Tab button */
#sidebar-toggle {
  position: absolute;
  left: 320px;
  top: 50%;
  transform: translateY(-50%) translateX(-50%);
  width: 18px;
  height: 52px;
  background: rgba(18, 18, 22, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: none;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  cursor: pointer;
  z-index: 105;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.3);
}

#sidebar-toggle:hover,
#sidebar-toggle.fake-hover {
  background: rgba(24, 24, 28, 0.95);
  color: #ffffff;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
}

#sidebar.collapsed #sidebar-toggle {
  left: 60px;
}

#sidebar.collapsed #sidebar-toggle .toggle-icon {
  transform: rotate(180deg);
}

#sidebar-toggle .toggle-icon {
  font-size: 10px;
  font-weight: bold;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Unified Bottom Status Bar */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 320px;
  right: 0;
  height: 40px;
  background: rgba(14, 14, 17, 0.8);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: #9ca3af;
  font-size: 11px;
  user-select: none;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

#sidebar.collapsed~#bottom-bar {
  left: 60px;
}

#bottom-brush {
  display: none;
  align-items: center;
  gap: 10px;
  margin-right: 15px;
  flex: 1;
}

#bottom-brush span {
  font-weight: 500;
  color: #9ca3af;
}

#bottom-brush input[type=range] {
  width: 110px;
  margin: 0;
}

#bottom-brush .val {
  color: #ffffff;
  font-weight: 600;
  min-width: 28px;
  text-align: right;
}

#bottom-speed {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 15px;
}

#bottom-speed span {
  font-weight: 500;
  color: #9ca3af;
}

#bottom-speed input[type=range] {
  width: 110px;
  margin: 0;
}

#bottom-speed .val {
  color: #ffffff;
  font-weight: 600;
  min-width: 24px;
  text-align: right;
}

#bottom-hud {
  display: flex;
  align-items: center;
  gap: 6px;
}

#bottom-hud span {
  font-weight: 500;
}

#fpsMeter {
  color: #10b981;
  font-weight: 600;
}

/* Crosshair & Overlay elements */
#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  display: none;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

#toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(15, 15, 18, 0.95);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 24px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#shotBtn {
  margin-top: 12px;
  width: 100%;
  padding: 10px 0;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font: 600 12px 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#shotBtn:hover,
#shotBtn.fake-hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  color: #fff;
}

#fake-cursor {
  position: fixed;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  display: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

/* Library overlay cards + quick strip */
#libraryOverlay { flex-direction: row; }
.lib-card {
  background: #18181b; border: 1px solid #27272a; border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
  transition: border-color 0.2s, transform 0.1s; position: relative;
}
.lib-card:hover { border-color: #ffd75e; transform: translateY(-2px); }
.lib-card .thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: #0b0b0d; display: block; }
.lib-card .meta { padding: 6px 8px; font-size: 10.5px; color: #d4d4d8; display: flex; flex-direction: column; gap: 2px; }
.lib-card .meta .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #f4f4f5; }
.lib-card .meta .tags { color: #71717a; font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-card .pin { position: absolute; top: 5px; right: 5px; background: rgba(0,0,0,0.6); border: 1px solid #3f3f46; color: #a1a1aa; border-radius: 6px; padding: 2px 6px; font-size: 11px; cursor: pointer; }
.lib-card .pin.pinned { color: #ffd75e; border-color: rgba(255,215,94,0.5); }
.lib-card .lib-actions { display: flex; gap: 4px; padding: 0 8px 8px; }
.lib-card .lib-actions button { flex: 1; font-size: 10px; padding: 4px 0; border-radius: 5px; }
.quick-chip {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 8px; border: 1px solid #27272a; overflow: hidden; cursor: pointer; position: relative; background: #18181b; flex-shrink: 0;
}
.quick-chip:hover { border-color: #ffd75e; }
.quick-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.quick-chip .chip-label { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.65); color: #fff; font-size: 8px; padding: 1px 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#hotkeys-widget {
  position: fixed;
  right: 20px;
  bottom: 60px;
  z-index: 1000;
  background: rgba(18, 18, 22, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  width: 230px;
  color: #9ca3af;
  font-size: 10.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  transition: opacity 0.3s;
}
#hotkeys-widget h4 {
  margin: 0 0 8px;
  font-size: 11px;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}
#hotkeys-widget .hotkey-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  line-height: 1.4;
}
#hotkeys-widget kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #ffffff;
  padding: 1px 4px;
  font-size: 9px;
  font-family: inherit;
  margin-left: 2px;
}

/* Keyframe Sidebar UI Styling */
.keyframe-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.keyframe-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.keyframe-item.selected {
  background: rgba(251, 191, 36, 0.06);
  border-color: rgba(251, 191, 36, 0.3);
}

.keyframe-item .kf-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 600;
}

.keyframe-item.selected .kf-index {
  background: #fbbf24;
  color: #0d0d10;
}

.keyframe-item .kf-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: #9ca3af;
}

.keyframe-item.selected .kf-info {
  color: #f3f4f6;
}

.keyframe-item .kf-info .kf-title {
  font-weight: 600;
}

.keyframe-item .kf-info .kf-meta {
  font-size: 9px;
  opacity: 0.8;
}

.keyframe-item .kf-actions {
  display: flex;
  gap: 3px;
}

.keyframe-item .kf-btn {
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
  transition: all 0.1s ease;
}

.keyframe-item .kf-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.keyframe-item.selected .kf-btn:hover {
  color: #fbbf24;
}

/* Custom Playback Timeline Floating Dock */
#floating-playback-controller {
  position: fixed;
  bottom: -160px; /* Hidden offscreen by default for cubic-bezier slide-in */
  left: 50%;
  transform: translateX(-50%) scale(0.96);
  z-index: 1000;
  width: 420px;
  max-width: 90vw;
  padding: 16px 20px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  background: rgba(18, 18, 24, 0.72) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: 
    bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
    opacity 0.35s ease-out;
  opacity: 0;
  pointer-events: none;
}

#floating-playback-controller.visible {
  bottom: 60px;
  transform: translateX(-50%) scale(1);
  opacity: 0.65; /* resting state opacity */
  pointer-events: auto;
}

#floating-playback-controller.visible:hover {
  opacity: 1 !important;
  transform: translateX(-50%) scale(1.01);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Fade out when playing and mouse is idle (Auto-hide) */
#floating-playback-controller.visible.idle {
  opacity: 0.25;
}

#floating-playback-controller.visible.idle:hover {
  opacity: 1 !important;
}

.timeline-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: #eab308; /* Amber color divisions */
  opacity: 0.8;
  z-index: 2;
  transition: all 0.15s ease;
}

.timeline-tick:hover {
  background: #fbbf24;
  width: 3px;
  transform: translateX(-0.75px);
  box-shadow: 0 0 4px rgba(251,191,36,0.6);
}

.custom-timeline-player button:hover {
  color: #f3f4f6 !important;
}

#customTimelineTrack {
  transition: height 0.15s ease, background-color 0.15s ease;
}

#customTimelineTrack:hover {
  height: 8px !important;
  background: rgba(255, 255, 255, 0.25) !important;
}

#customTimelineTrack:hover #customTimelineKnob {
  width: 13px !important;
  height: 13px !important;
  background: #22d3ee !important;
  box-shadow: 0 0 8px rgba(34,211,238,0.7);
}

#customTimelineTrack:hover #customTimelineFill {
  border-radius: 4px;
}

#timeline-restore-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  transform: translateX(-50%) scale(1.05) !important;
  box-shadow: 0 6px 20px rgba(34,211,238,0.3) !important;
}

#customPlayerCloseBtn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #e5e7eb !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

