/* ============================================
   SPARK PRO ANIMAKER - DESKTOP STUDIO UI
   Visual Studio-like Layout
   ============================================ */

:root {
  /* Color Palette - Dark Theme */
  --bg-primary: #1e1e1e;
  --bg-secondary: #252526;
  --bg-tertiary: #2d2d30;
  --bg-elevated: #3e3e42;

  --border-color: #3e3e42;
  --border-active: #007acc;

  --text-primary: #cccccc;
  --text-secondary: #969696;
  --text-muted: #6a6a6a;

  --accent-blue: #007acc;
  --accent-blue-hover: #1c8dd4;
  --accent-green: #00c853;
  --accent-red: #f44336;

  --panel-header-bg: #2d2d30;
  --menu-bar-bg: #3c3c3c;
  --status-bar-bg: #007acc;

  /* Spacing */
  --panel-padding: 12px;
  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-lg: 16px;

  /* Sizes */
  --menu-bar-height: 36px;
  --status-bar-height: 24px;
  --panel-header-height: 40px;
  --left-panel-width: 280px;
  --right-panel-width: 320px;
  --bottom-panel-height: 200px;

  /* Mappings for missing variables */
  --primary: var(--accent-green);
  --surface: var(--bg-secondary);
  --border: var(--border-color);
  --bg: var(--bg-primary);
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Anek Telugu', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: 'Anek Telugu', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow: hidden;
  height: 100vh;
}

/* ============================================
   AUTHENTICATION OVERLAY
   ============================================ */

.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-card {
  background: white;
  border-radius: 12px;
  padding: 40px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  color: #667eea;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 8px;
}

.auth-header p {
  color: #666;
  font-size: 14px;
}

.auth-form h2 {
  color: #333;
  font-size: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #333;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 13px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.form-group small {
  color: #999;
  font-size: 12px;
}

.btn-google {
  width: 100%;
  padding: 12px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.2s;
  margin-bottom: 20px;
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #ccc;
}

.btn-auth-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-auth-primary:hover {
  transform: translateY(-2px);
}

.divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
  color: #999;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e0e0e0;
}

.divider span {
  background: white;
  padding: 0 12px;
  position: relative;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
}

.auth-footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-message {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  text-align: center;
}

.auth-message.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef5350;
}

.auth-message.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #66bb6a;
}

/* ============================================
   APP CONTAINER
   ============================================ */

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ============================================
   TOP MENU BAR
   ============================================ */

.menu-bar {
  height: var(--menu-bar-height);
  background: var(--menu-bar-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-right: 1px solid var(--border-color);
  margin-right: 8px;
}

.logo-icon {
  font-size: 18px;
}

.app-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}

.menu-items {
  display: flex;
  gap: 4px;
}

.menu-item {
  position: relative;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}

.menu-btn:hover {
  background: var(--bg-elevated);
}

.menu-item:hover .dropdown-menu {
  display: block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  margin-top: 2px;
}

.dropdown-item {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 8px 16px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--bg-elevated);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.menu-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name-display {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-logout {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-blue);
}

/* ============================================
   STUDIO LAYOUT (Main 3-Panel Layout)
   ============================================ */

.studio-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ============================================
   PANELS - Common Styles
   ============================================ */

.panel {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: relative;
}

.panel-header {
  height: var(--panel-header-height);
  background: var(--panel-header-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--panel-padding);
  flex-shrink: 0;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-tabs {
  display: flex;
  gap: 0;
  height: 100%;
}

.panel-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0 16px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  height: 100%;
}

.panel-tab:hover {
  color: var(--text-primary);
}

.panel-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-blue);
}

.panel-actions {
  display: flex;
  gap: 4px;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--panel-padding);
}

/* Custom Scrollbar */
.panel-content::-webkit-scrollbar {
  width: 8px;
}

.panel-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.panel-content::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ============================================
   LEFT PANEL - Scene Explorer
   ============================================ */

.left-panel {
  width: var(--left-panel-width);
  flex-shrink: 0;
}

.toolbar {
  margin-bottom: 12px;
}

.toolbar-btn {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.toolbar-btn:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.scene-explorer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scene-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.scene-card:hover {
  border-color: var(--accent-blue);
  background: var(--bg-elevated);
}

.scene-card.active {
  border-color: var(--accent-blue);
  background: var(--bg-elevated);
}

.scene-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.scene-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.scene-actions {
  display: flex;
  gap: 4px;
}

.scene-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.15s;
}

.scene-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.scene-info {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Scene Card Input Elements */
.scene-card input[type="text"],
.scene-card input[type="number"],
.scene-card select,
.scene-input,
.anim-select,
.scene-duration,
.scene-size {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.15s;
  width: 100%;
}

.scene-card input[type="text"]:focus,
.scene-card input[type="number"]:focus,
.scene-card select:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--bg-secondary);
}

.scene-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.scene-card input[type="checkbox"] {
  margin-right: 6px;
  cursor: pointer;
}

.highlight-toggle {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.scene-card input[type="color"] {
  width: 40px;
  height: 28px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  background: var(--bg-primary);
}

.scene-card input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.scene-card input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
}

.scene-card input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.scene-effects,
.scene-transform {
  margin-top: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-primary);
}

.scene-effects summary,
.scene-transform summary {
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.scene-effects summary:hover,
.scene-transform summary:hover {
  color: var(--text-primary);
}

.effects-panel,
.transform-panel {
  padding: 8px;
  border-top: 1px solid var(--border-color);
}

.effect-toggle,
.effect-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.alignment-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 32px;
  height: 28px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.alignment-btn:hover {
  background: var(--bg-primary);
  border-color: var(--accent-blue);
}

.alignment-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.scene-card.selected {
  border-color: var(--accent-green);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.2);
}

.placeholder-text {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 16px;
  font-size: 12px;
}

/* Simplified Scene List Items */
.scene-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.scene-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 200, 83, 0.1);
}

.scene-card.selected {
  border-color: var(--primary);
  background: rgba(0, 200, 83, 0.05);
}

.scene-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.scene-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.scene-content {
  flex: 1;
  min-width: 0;
}

.scene-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.scene-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.remove-scene {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.remove-scene:hover {
  background: #ff4444;
  border-color: #ff4444;
  color: white;
}

/* Asset Cards */
.asset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: grab;
  transition: all 0.2s;
}

.asset-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 200, 83, 0.1);
}

.asset-card:active {
  cursor: grabbing;
}

.asset-preview {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-icon {
  font-size: 32px;
}

.asset-info {
  flex: 1;
  min-width: 0;
}

.asset-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.asset-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.asset-actions {
  display: flex;
  gap: 4px;
}

.asset-action-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.asset-action-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
}

.asset-action-btn.add-to-canvas:hover {
  background: var(--primary);
  color: white;
}

.asset-action-btn.delete-asset:hover {
  background: #ff4444;
  border-color: #ff4444;
  color: white;
}

/* Modal Overlay & Preferences Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.modal-dialog {
  background: var(--surface);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.pref-section {
  margin-bottom: 32px;
}

.pref-section:last-child {
  margin-bottom: 0;
}

.pref-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Properties Header */
.props-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.close-props-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all 0.2s;
}

.close-props-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--text-primary);
}

/* Property Value Display */
.property-value {
  font-size: 13px;
  color: var(--text-primary);
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--border);
  font-weight: 500;
}

/* Asset Properties Panel */
.asset-properties {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

.asset-properties .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.asset-properties .panel-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-btn:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.properties-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.property-group {
  margin-bottom: 20px;
}

.property-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-value {
  font-size: 13px;
  color: var(--text-primary);
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--border);
}

.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.input-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 12px;
}

.input-unit {
  font-size: 11px;
  color: var(--text-secondary);
}

.prop-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'Inter', system-ui, sans-serif;
}

.prop-input:focus {
  outline: none;
  border-color: var(--primary);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::-ms-track {
  width: 100%;
  height: 6px;
  background: transparent;
  border-color: transparent;
  color: transparent;
}

.slider::-ms-fill-lower {
  background: var(--primary);
  border-radius: 3px;
}

.slider::-ms-fill-upper {
  background: var(--border);
  border-radius: 3px;
}

.slider::-ms-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  min-width: 40px;
  text-align: right;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: var(--text-primary) !important;
  margin-top: 8px;
  text-transform: none !important;
  letter-spacing: normal !important;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
}

.button-row {
  display: flex;
  gap: 8px;
}

.prop-btn {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.prop-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.prop-btn.danger {
  width: 100%;
  color: #ff4444;
  border-color: #ff4444;
}

.prop-btn.danger:hover {
  background: #ff4444;
  color: white;
}

/* ============================================
   CENTER AREA - Canvas + Timeline
   ============================================ */

.center-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

.canvas-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.canvas-toolbar {
  height: 40px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 32px;
  height: 28px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: var(--bg-primary);
  border-color: var(--accent-blue);
}

.zoom-display {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 50px;
  text-align: center;
}

.btn-play {
  background: var(--accent-blue);
  border: none;
  color: white;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-play:hover {
  background: var(--accent-blue-hover);
}

.btn-play:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 20px;
  background: var(--bg-primary);
}

#stage {
  background: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ============================================
   BOTTOM PANEL - Timeline
   ============================================ */

.bottom-panel {
  height: var(--bottom-panel-height);
  border-top: 1px solid var(--border-color);
  border-right: none;
  flex-shrink: 0;
}

.bottom-panel.collapsed {
  height: var(--panel-header-height);
}

.bottom-panel.collapsed .panel-content {
  display: none;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
}

.playback-buttons {
  display: flex;
  gap: 6px;
}

.control-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.timeline-seeker {
  flex: 1;
}

#seeker {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

#seeker::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
}

#seeker::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.time-display {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 100px;
  text-align: right;
  font-family: 'Courier New', monospace;
}

.audio-section {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-primary {
  background: var(--accent-blue);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: var(--bg-primary);
  border-color: var(--accent-blue);
}

#audio-info {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================
   RIGHT PANEL - Properties
   ============================================ */

.right-panel {
  width: var(--right-panel-width);
  border-right: none;
  border-left: 1px solid var(--border-color);
  flex-shrink: 0;
}

.properties-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.section-title:first-child {
  margin-top: 0;
}

.property-group {
  margin-bottom: 12px;
}

.property-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.property-input,
.property-select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.15s;
}

.property-input:focus,
.property-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--bg-elevated);
}

.input-group {
  display: flex;
  gap: 6px;
}

.property-select-mini {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px;
  border-radius: 4px;
  font-size: 13px;
  width: 48px;
  cursor: pointer;
}

.property-color {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  background: var(--bg-tertiary);
}

/* Code Editor */
.code-editor {
  height: 100%;
}

#prompt {
  width: 100%;
  height: 100%;
  min-height: 400px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
}

#prompt:focus {
  outline: none;
  border-color: var(--accent-blue);
}

/* ============================================
   RESIZE HANDLES
   ============================================ */

.panel-resize-handle {
  position: absolute;
  background: transparent;
  z-index: 10;
  transition: background 0.15s;
}

.panel-resize-handle:hover {
  background: var(--accent-blue);
}

.panel-resize-right {
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  cursor: ew-resize;
}

.panel-resize-left {
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  cursor: ew-resize;
}

.panel-resize-top {
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  cursor: ns-resize;
}

/* ============================================
   STATUS BAR
   ============================================ */

.status-bar {
  height: var(--status-bar-height);
  background: var(--status-bar-bg);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
  color: white;
  flex-shrink: 0;
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-text {
  font-weight: 500;
}

.status-item {
  opacity: 0.9;
  font-size: 11px;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1024px) {
  :root {
    --left-panel-width: 240px;
    --right-panel-width: 280px;
  }
}

/* ============================================
   RESPONSIVE - MOBILE (Fallback)
   ============================================ */

@media (max-width: 768px) {
  .studio-layout {
    flex-direction: column;
  }

  .left-panel,
  .right-panel {
    display: none;
  }

  .bottom-panel {
    height: auto;
  }

  .menu-bar {
    display: none;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
  display: none !important;
}

.panel-collapsed {
  display: none;
}