:root {
  --bg: #1e1e1e;
  --text: #cccccc;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#editor {
  width: 100%;
  height: 100vh;
}

.hidden {
  display: none !important;
}

.not-found-view {
  width: 100%;
  height: 100vh;
  background: #2b2d31;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.not-found-image {
  max-width: min(960px, 96vw);
  max-height: calc(100vh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.image-view {
  width: 100%;
  height: 100vh;
  background: #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.image-preview {
  max-width: min(1200px, 96vw);
  max-height: calc(100vh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
}

.admin-sidebar {
  border-right: 1px solid #333;
  background: #252526;
  overflow: auto;
}

.admin-sidebar-header {
  height: 35px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #9d9d9d;
}

.admin-tree {
  padding: 8px 6px 20px;
}

.tree-item {
  user-select: none;
  font-size: 13px;
  line-height: 24px;
  border-radius: 4px;
  padding: 0 8px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-item:hover {
  background: #2a2d2e;
}

.tree-item.active {
  background: #094771;
}

.tree-item.directory {
  color: #d7ba7d;
}

.tree-item.file {
  color: #ccc;
}

.admin-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #1e1e1e;
}

.admin-main #editor {
  flex: 1;
  min-height: 0;
  height: auto;
}

.admin-main .image-view,
.admin-main .not-found-view {
  flex: 1;
  min-height: 0;
  height: auto;
}

.admin-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #333;
  background: #2d2d2d;
}

.admin-file-label {
  font-size: 12px;
  color: #ccc;
  font-family: ui-monospace, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.share-status {
  font-size: 12px;
  color: #89d185;
  max-width: 280px;
}

.admin-shares {
  flex-shrink: 0;
  padding: 8px 12px;
  border-bottom: 1px solid #333;
  background: #252526;
  font-size: 12px;
}

.admin-shares-empty {
  margin: 0;
  color: #9d9d9d;
}

.admin-share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-share-code {
  font-family: ui-monospace, monospace;
  color: #4fc1ff;
}

.admin-share-date {
  color: #9d9d9d;
}

.btn-primary,
.btn-danger {
  font-size: 12px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-primary {
  background: #0e639c;
  color: #fff;
}

.btn-primary:hover {
  background: #1177bb;
}

.btn-danger {
  background: #5a1d1d;
  color: #f48771;
}

.btn-danger:hover {
  background: #702626;
}
