/* 3D Mode UI Styles — Animation Studio */

/* ============================================================================
   3D VIEWPORT — positioned by styles.css, these just override display
   ============================================================================ */

#three-viewport {
  /* styles.css sets position: absolute; inset: 38px 0 0 0; display: none */
  /* CSS gradient shows through the alpha:true WebGL canvas */
  background: radial-gradient(ellipse at 50% 0%, #1c1c28 0%, #111118 45%, #08080e 100%);
}

#three-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================================================
   LIB3D ROOT & SEARCH
   ============================================================================ */

/* #lib-3d is inside .drawer-section which is flex-col flex:1 */
.lib3d-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Search bar */
.lib3d-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px 6px;
  flex-shrink: 0;
  position: relative;
}
.lib3d-search-icon {
  position: absolute;
  left: 24px;
  color: #555;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.lib3d-search-input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.07);
  color: #e0e0e0;
  border-radius: 8px;
  padding: 7px 10px 7px 28px;
  font-size: 12.5px;
  font-family: Inter, sans-serif;
  transition: border-color 0.15s;
  outline: none;
}
.lib3d-search-input:focus { border-color: #4f78ff; background: #111; }
.lib3d-search-input::placeholder { color: #444; }
.lib3d-ext-search-btn {
  background: rgba(79,120,255,0.1);
  border: 1px solid rgba(79,120,255,0.3);
  color: #4f78ff;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.lib3d-ext-search-btn:hover { background: #4f78ff; color: #fff; }

/* Tab bar */
.lib3d-tab-bar {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 8px;
  flex-shrink: 0;
}
.lib3d-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #555;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: Inter, sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.lib3d-tab-btn:hover { color: #aaa; }
.lib3d-tab-btn.active { color: #4f78ff; border-bottom-color: #4f78ff; }
.lib3d-tab-icon { font-size: 13px; }

/* Shared panel wrapper */
.lib3d-panel {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ============================================================================
   LIBRARY PANEL
   ============================================================================ */

.lib3d-library-panel { display: flex; } /* default visible */

/* Filters */
.lib3d-filters {
  padding: 8px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.lib3d-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.lib3d-pill {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.07);
  color: #666;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-family: Inter, sans-serif;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.lib3d-pill:hover { color: #ccc; border-color: rgba(255,255,255,0.15); }
.lib3d-pill.active { background: #4f78ff; border-color: #4f78ff; color: #fff; }

/* Grid */
.lib3d-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 12px;
}
.lib3d-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Asset card — horizontal list style (like Canva elements) */
.lib3d-asset-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: default;
  transition: all 0.12s;
}
.lib3d-asset-card:hover {
  border-color: rgba(79,120,255,0.4);
  background: rgba(79,120,255,0.06);
}
.lib3d-asset-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.lib3d-asset-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lib3d-asset-name {
  font-size: 12.5px;
  color: #ddd;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib3d-asset-meta {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.lib3d-badge {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.lib3d-badge-src { background: rgba(255,255,255,0.06); color: #666; border: 1px solid rgba(255,255,255,0.08); }
.lib3d-badge-anim { background: rgba(79,120,255,0.12); color: #4f78ff; border: 1px solid rgba(79,120,255,0.25); }
.lib3d-badge-static { background: rgba(255,255,255,0.04); color: #555; border: 1px solid rgba(255,255,255,0.06); }

.lib3d-add-btn {
  background: rgba(79,120,255,0.1);
  border: 1px solid rgba(79,120,255,0.25);
  color: #4f78ff;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.lib3d-add-btn:hover { background: #4f78ff; color: #fff; }
.lib3d-add-btn.loading { opacity: 0.5; pointer-events: none; }
.lib3d-add-btn.loaded { background: rgba(52,211,153,0.12); border-color: #34d399; color: #34d399; }
.lib3d-add-btn.error { background: rgba(248,113,113,0.12); border-color: #f87171; color: #f87171; }

/* Empty state */
.lib3d-empty {
  text-align: center;
  padding: 32px 16px;
  color: #555;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.lib3d-empty-icon { font-size: 28px; opacity: 0.4; }

/* ============================================================================
   DISCOVER PANEL
   ============================================================================ */

.lib3d-discover-panel {
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  padding: 10px 10px 16px;
}
.lib3d-discover-heading {
  font-size: 11px;
  color: #555;
  margin-bottom: 10px;
  padding: 0 2px;
}
.lib3d-discover-heading span { color: #444; }

.lib3d-discover-card {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.lib3d-discover-card:hover { border-color: rgba(255,255,255,0.12); }

.lib3d-discover-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.lib3d-discover-icon { font-size: 20px; }
.lib3d-discover-title-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lib3d-discover-name { font-size: 13px; font-weight: 600; color: #e0e0e0; }
.lib3d-discover-badge {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.lib3d-discover-desc {
  font-size: 11.5px;
  color: #777;
  line-height: 1.5;
  margin-bottom: 4px;
}
.lib3d-discover-hint {
  font-size: 10.5px;
  color: #4a4a4a;
  margin-bottom: 10px;
  font-style: italic;
}

.lib3d-discover-actions { display: flex; gap: 6px; }
.lib3d-discover-btn {
  background: #222;
  border: 1px solid rgba(255,255,255,0.08);
  color: #aaa;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.lib3d-discover-btn:hover { background: #2a2a2a; color: #fff; border-color: rgba(255,255,255,0.15); }
.lib3d-discover-btn.lib3d-btn-primary { background: #4f78ff; color: #fff; border-color: #4f78ff; }
.lib3d-discover-btn.lib3d-btn-primary:hover { background: #3d65f0; }

/* ============================================================================
   IMPORT PANEL
   ============================================================================ */

.lib3d-import-panel {
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  padding: 10px 10px 16px;
}
.lib3d-import-section {
  margin-bottom: 16px;
}
.lib3d-import-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  margin-bottom: 8px;
}

/* URL input row */
.lib3d-url-row { display: flex; gap: 6px; }
.lib3d-url-input {
  flex: 1;
  background: #111;
  border: 1px solid rgba(255,255,255,0.07);
  color: #ccc;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 11.5px;
  font-family: 'Courier New', monospace;
  outline: none;
  transition: border-color 0.15s;
}
.lib3d-url-input:focus { border-color: #4f78ff; background: #0d0d0d; }
.lib3d-url-input::placeholder { color: #333; }
.lib3d-btn-primary {
  background: #4f78ff;
  border: none;
  color: #fff;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.lib3d-btn-primary:hover { background: #3d65f0; }

/* Drop zone */
.lib3d-drop-zone {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.lib3d-drop-zone:hover,
.lib3d-drop-zone.drag-over {
  border-color: #4f78ff;
  background: rgba(79,120,255,0.05);
  color: #4f78ff;
}
.lib3d-drop-icon { font-size: 28px; margin-bottom: 2px; }
.lib3d-drop-text { font-size: 12.5px; font-weight: 500; }
.lib3d-drop-hint { font-size: 11px; color: #444; }

/* Quick links */
.lib3d-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 7px;
  margin-bottom: 5px;
}
.lib3d-link-label { font-size: 11.5px; color: #aaa; flex: 1; }
.lib3d-link-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: #666;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}
.lib3d-link-btn:hover { color: #4f78ff; border-color: rgba(79,120,255,0.4); }

/* ============================================================================
   TOAST
   ============================================================================ */

.lib3d-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.1);
  color: #e0e0e0;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 12.5px;
  font-family: Inter, sans-serif;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 9999;
  white-space: nowrap;
}
.lib3d-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.lib3d-toast.lib3d-toast-error { border-color: rgba(248,113,113,0.4); color: #f87171; }

