/* =====================================================
   sidebar.css — Left Sidebar + Right Sidebar
   ===================================================== */

/* ── LEFT SIDEBAR ── */
#leftSidebar {
  width: var(--sidebar-l);
  flex-shrink: 0;
  background: var(--bg1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-inner {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  margin: 16px 0 4px;
}

.sidebar-section-title {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
}

.sidebar-add-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.sidebar-add-btn:hover { background: var(--bg3); color: var(--text1); }

/* Folder items */
.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
  user-select: none;
}
.folder-item:hover { background: rgba(255, 255, 255, 0.04); }
.folder-item.active { background: rgba(10, 132, 255, 0.15); }

.folder-icon { flex-shrink: 0; display: flex; color: var(--text3); }
.folder-item.active .folder-icon { color: var(--accent); }

.folder-name {
  flex: 1;
  font-size: 13px;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-item.active .folder-name { color: var(--accent); }

.folder-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text3);
  background: var(--bg3);
  border-radius: 10px;
  padding: 1px 6px;
  flex-shrink: 0;
  min-width: 20px;
  text-align: center;
}

.folder-delete-btn {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: none;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.folder-item:hover .folder-delete-btn { display: flex; }
.folder-delete-btn:hover { background: rgba(255, 69, 58, 0.15); color: var(--danger); }

/* Inline folder name input */
.folder-inline-input {
  height: 28px;
  border-radius: var(--radius-ui);
  border: 1px solid var(--accent);
  background: var(--bg3);
  color: var(--text1);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 0 10px;
  outline: none;
  margin: 4px 14px;
  width: calc(100% - 28px);
}

/* Sidebar footer (empty trash) */
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

#emptyTrashBtn {
  width: 100%;
  height: 28px;
  border-radius: var(--radius-ui);
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}
#emptyTrashBtn:hover { background: rgba(255, 69, 58, 0.12); }

/* ── RIGHT SIDEBAR ── */
#rightSidebar {
  width: var(--sidebar-r);
  flex-shrink: 0;
  background: var(--bg1);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Empty state */
#rsEmpty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text3);
}
#rsEmpty p { font-size: 13px; }

/* Detail panel */
#rsDetail {
  flex: 1;
  overflow-y: auto;
  display: none;
  flex-direction: column;
}

/* Image preview */
#rsPreview {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
#rsPreview img { width: 100%; height: 100%; object-fit: contain; }

/* Collapsible sections */
.rs-sections { padding-bottom: 16px; }

.rs-section { border-bottom: 1px solid var(--border); }

.rs-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.rs-section-header:hover { background: rgba(255, 255, 255, 0.03); }

.rs-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
}

.rs-chevron {
  color: var(--text3);
  display: flex;
  transition: transform var(--transition);
}
.rs-section.open .rs-chevron { transform: rotate(90deg); }

.rs-section-body { padding: 0 14px 12px; display: none; }
.rs-section.open .rs-section-body { display: block; }

/* Textarea and input fields */
.rs-textarea {
  width: 100%;
  min-height: 72px;
  border-radius: var(--radius-ui);
  border: 1px solid transparent;
  background: var(--bg3);
  color: var(--text1);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 10px;
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.rs-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.13);
}
.rs-textarea::placeholder { color: var(--text3); }

.rs-input {
  width: 100%;
  height: 32px;
  border-radius: var(--radius-ui);
  border: 1px solid transparent;
  background: var(--bg3);
  color: var(--text1);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 0 10px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.rs-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.13);
}
.rs-input::placeholder { color: var(--text3); }

/* Source URL */
.rs-source-wrap { position: relative; display: flex; align-items: center; }
.rs-source-icon { position: absolute; left: 9px; color: var(--text3); display: flex; pointer-events: none; }
.rs-source-wrap .rs-input { padding-left: 30px; }

.rs-source-link {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rs-source-link:hover { text-decoration: underline; }

/* Tag chips */
.tag-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  border-radius: 20px;
  padding: 3px 8px 3px 9px;
  font-size: 11.5px;
  color: var(--text2);
  border: 1px solid var(--border);
}

.tag-chip-remove {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color var(--transition), background var(--transition);
}
.tag-chip-remove:hover { color: var(--danger); background: rgba(255, 69, 58, 0.1); }

.tag-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 20px;
  border: 1px dashed var(--border-hover);
  background: transparent;
  color: var(--text3);
  font-family: var(--font-ui);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.tag-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(10, 132, 255, 0.07);
}

/* Folder pill + move button */
.folder-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text2);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.folder-pill-icon { color: var(--yellow); display: flex; }

.folder-move-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 20px;
  border: 1px dashed var(--border-hover);
  background: transparent;
  color: var(--text3);
  font-family: var(--font-ui);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.folder-move-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(10, 132, 255, 0.07);
}

/* Properties grid */
.props-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: start;
}
.prop-label { font-size: 11.5px; color: var(--text3); white-space: nowrap; }
.prop-value { font-family: var(--font-mono); font-size: 11.5px; color: var(--text2); word-break: break-all; }

/* Color swatches */
.color-strip {
  display: flex;
  height: 32px;
  border-radius: var(--radius-ui);
  overflow: hidden;
  width: 100%;
  margin-bottom: 4px;
}

.color-swatch {
  height: 100%;
  cursor: crosshair;
  transition: flex var(--transition);
}

.color-tooltip {
  position: fixed;
  background: var(--surface2);
  border: 1px solid var(--border-hover);
  border-radius: 7px;
  padding: 6px 10px;
  z-index: 300;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text1);
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  transform-origin: bottom center;
  transition: opacity 120ms, transform 120ms;
}
.color-tooltip.hidden { opacity: 0; transform: scale(0.85) translateY(4px); }
.color-tooltip.visible { opacity: 1; transform: scale(1) translateY(0); }

/* Export buttons */
.export-row { display: flex; gap: 8px; }

.export-btn {
  flex: 1;
  height: 32px;
  border-radius: var(--radius-ui);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.export-btn:hover {
  background: var(--surface2);
  color: var(--text1);
  border-color: var(--border-hover);
}
