@import '../common.css';

:root {
  --sidebar-width: 300px;
  --header-gap: 12px;
}

/* --- Header / Drop zone --- */

#header {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  flex-shrink: 0;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.drop-zone.over {
  border-color: var(--accent);
  background: var(--tree-selected);
}

.drop-zone.compact {
  padding: 6px 14px;
  flex: 0 auto;
}

#picker {
  font-size: 14px;
  cursor: pointer;
}

#status {
  color: var(--text-muted);
  font-size: 13px;
}

/* --- Keys panel (pck variant: white bg, border-bottom) --- */

.keys-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.keys-panel.hidden { display: none; }

/* --- Explorer layout --- */

#explorer {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* --- Breadcrumb --- */

#breadcrumb {
  padding: 8px 16px;
  font-size: 13px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.crumb {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 3px;
}

.crumb:hover { background: var(--tree-hover); }

.crumb-sep { color: var(--text-muted); font-size: 11px; }

.crumb-current {
  color: var(--text);
  font-weight: 600;
  padding: 2px 4px;
}

/* --- Preview content --- */

#preview pre {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  tab-size: 4;
}

#preview pre code {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  display: block;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-x: auto;
}

#preview .hex-dump {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  white-space: pre;
  overflow-x: auto;
}

#preview .hex-offset { color: var(--text-muted); }
#preview .hex-bytes { color: var(--text); }
#preview .hex-ascii { color: var(--accent); }

#preview .image-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#preview .image-preview img,
#preview .image-preview .canvas-preview {
  max-width: 100%;
  max-height: 70vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}

#preview .image-preview .image-info {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Actions extras --- */

#actions .file-info {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover { background: var(--accent-hover); }

.encoding-select {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* --- Scrollbar styling --- */

#sidebar::-webkit-scrollbar,
#preview::-webkit-scrollbar {
  width: 8px;
}

#sidebar::-webkit-scrollbar-thumb,
#preview::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 4px;
}

#sidebar::-webkit-scrollbar-thumb:hover,
#preview::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}
