/* Clouwndrive — cd.css
   Metallic paars / zwart thema
   Vervang dit bestand per klant voor een aangepast uiterlijk
*/

:root {
  /* Paars metallic palet */
  --gray:        #2d1f3d;   /* hoofd venster achtergrond */
  --gray-mid:    #3d2d52;   /* iets lichter paars voor toolbars */
  --gray-light:  #4a3860;   /* hover achtergronden, randen hi */
  --gray-xlight: #5a4870;   /* lichtste paars tint */
  --blue:        #1a0a2e;   /* titlebar donker paars-zwart */
  --blue-sel:    #6b21a8;   /* selectie / actief paars */
  --white:       #e8d8ff;   /* tekst op donkere achtergrond */
  --black:       #0a0010;   /* body achtergrond */

  /* Rand simulatie: raised = licht boven/links, donker rechts/onder */
  --border-hi:   #7c5fa0;
  --border-lo:   #150a25;

  /* Inset (sunken) omgekeerd */
  --inset-hi:    #150a25;
  --inset-lo:    #7c5fa0;

  /* Tekst kleuren */
  --text:        #e8d8ff;
  --text-dim:    #9878c0;
  --text-sel:    #fff;
  --text-dark:   #0a0010;

  /* File view — licht grijs/wit gebied */
  --file-bg:       #f0eeeb;   /* file panel, tree, preview achtergrond */
  --file-bg-dark:  #dedad4;   /* donkerder tint voor preview-img, tekst-pre */
  --file-row-alt:  #e8e4de;   /* header rij */
  --file-text:     #1a0010;   /* tekst in file view */
  --file-text-dim: #7a6080;   /* gedimde tekst in file view */
  --file-border-h: #ffffff;   /* raised rand hoog */
  --file-border-l: #a89e90;   /* raised rand laag */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "MS Sans Serif","Arial",sans-serif;
  font-size: 15px;
  background: var(--black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  color: var(--text);
}

.raised {
  border-top: 2px solid var(--border-hi);
  border-left: 2px solid var(--border-hi);
  border-right: 2px solid var(--border-lo);
  border-bottom: 2px solid var(--border-lo);
}

.window {
  background: var(--gray);
  min-width: 800px;
  max-width: 1600px;
  width: 98vw;
}

/* ── Titlebar ── */
.titlebar {
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  padding: 3px 3px 3px 6px;
  gap: 4px;
  font-weight: bold;
  font-size: 15px;
  background: linear-gradient(180deg, #2a0a4a 0%, #1a0a2e 60%, #0f0620 100%);
}

.titlebar .icon { font-size: 18px; margin-right: 2px; }
.titlebar .title { flex: 1; color: var(--white); }

.titlebar .winbtn {
  background: var(--gray-mid);
  width: 20px;
  height: 18px;
  border-top: 1px solid var(--border-hi);
  border-left: 1px solid var(--border-hi);
  border-right: 1px solid var(--border-lo);
  border-bottom: 1px solid var(--border-lo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--white);
}

.titlebar .winbtn:active {
  border-top: 1px solid var(--border-lo);
  border-left: 1px solid var(--border-lo);
  border-right: 1px solid var(--border-hi);
  border-bottom: 1px solid var(--border-hi);
}

/* ── Taalknop ── */
.lang-btn {
  padding: 0 5px;
  height: 14px;
  line-height: 14px;
  background: var(--gray-mid);
  color: var(--white);
  border-top: 1px solid var(--border-hi);
  border-left: 1px solid var(--border-hi);
  border-right: 1px solid var(--border-lo);
  border-bottom: 1px solid var(--border-lo);
  font-size: 9px;
  text-align: center;
  cursor: pointer;
  flex-shrink: 0;
}

.lang-btn.actief { background: var(--blue-sel); color: #fff; }
.lang-btn:hover  { background: var(--blue-sel); color: #fff; }

/* ── Menubar ── */
.menubar {
  background: var(--gray-mid);
  display: flex;
  padding: 2px 4px 0;
  border-bottom: 1px solid var(--border-lo);
}

.menubar span {
  padding: 3px 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
}

.menubar span:hover { background: var(--blue-sel); color: #fff; }

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-lo);
  background: var(--gray-mid);
  flex-wrap: wrap;
}

.toolbar .sep {
  width: 1px;
  height: 26px;
  background: var(--border-lo);
  margin: 0 2px;
  box-shadow: 1px 0 0 var(--border-hi);
}

/* ── Actionbar ── */
.actionbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-top: 1px solid var(--border-lo);
  flex-wrap: wrap;
  background: var(--gray-mid);
  justify-content: space-between;
}

.actionbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.actionbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.actionbar .sep {
  width: 1px;
  height: 26px;
  background: var(--border-lo);
  margin: 0 2px;
  box-shadow: 1px 0 0 var(--border-hi);
}

/* ── Knoppen ── */
.btn {
  background: linear-gradient(180deg, var(--gray-light) 0%, var(--gray) 100%);
  border-top: 2px solid var(--border-hi);
  border-left: 2px solid var(--border-hi);
  border-right: 2px solid var(--border-lo);
  border-bottom: 2px solid var(--border-lo);
  padding: 3px 10px;
  cursor: pointer;
  font-family: "MS Sans Serif","Arial",sans-serif;
  font-size: 15px;
  min-width: 32px;
  white-space: nowrap;
  color: var(--text);
}

.btn:hover {
  background: linear-gradient(180deg, var(--gray-xlight) 0%, var(--gray-mid) 100%);
  color: #fff;
}

.btn:active, .btn.active {
  border-top: 2px solid var(--border-lo);
  border-left: 2px solid var(--border-lo);
  border-right: 2px solid var(--border-hi);
  border-bottom: 2px solid var(--border-hi);
  padding: 4px 9px 2px 11px;
  background: var(--blue-sel);
  color: #fff;
}

.btn:disabled { color: var(--text-dim); cursor: default; }

/* ── Adressbalk ── */
.addrbar {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-lo);
  background: var(--gray);
}

.addrbar-left {
  width: 225px;
  min-width: 225px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 6px;
  background: var(--gray-mid);
  font-size: 15px;
  color: var(--text);
}

.addrbar-right { flex: 1; padding: 4px 8px; }

.zoek-input {
  width: 100%;
  background: var(--file-bg);
  border-top: 2px solid var(--file-border-h);
  border-left: 2px solid var(--file-border-h);
  border-right: 2px solid var(--file-border-l);
  border-bottom: 2px solid var(--file-border-l);
  padding: 2px 6px;
  font-family: "MS Sans Serif","Arial",sans-serif;
  font-size: 15px;
  outline: none;
  color: var(--file-text);
}

.zoek-input::placeholder { color: var(--file-text-dim); }

/* ── Hoofdpaneel ── */
.main-panel {
  display: flex;
  height: calc(100vh - 220px);
  min-height: 400px;
}

/* ── Preview paneel ── */
.preview-panel {
  width: 280px;
  min-width: 220px;
  background: var(--file-bg);
  border-top: 2px solid var(--file-border-h);
  border-left: 2px solid var(--file-border-h);
  border-right: 2px solid var(--file-border-l);
  border-bottom: 2px solid var(--file-border-l);
  margin: 4px 6px 4px 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.preview-img {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--file-bg-dark);
  overflow: hidden;
  min-height: 0;
}

.preview-img img { max-width: 100%; max-height: 100%; object-fit: contain; }

.preview-img .no-preview {
  color: var(--file-text-dim);
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.preview-exif {
  padding: 6px 8px;
  font-size: 11px;
  border-bottom: 1px solid var(--file-border-l);
  overflow-y: auto;
  max-height: 45%;
  color: var(--file-text);
  background: var(--file-bg);
}

.preview-exif table { width: 100%; border-collapse: collapse; }
.preview-exif td { padding: 1px 4px; vertical-align: top; }

.preview-exif td:first-child {
  color: #6b21a8;
  font-weight: bold;
  white-space: nowrap;
  width: 90px;
}

.preview-none {
  color: var(--file-text-dim);
  font-size: 12px;
  padding: 10px 8px;
  text-align: center;
}

/* ── Tree paneel ── */
.tree-panel {
  width: 220px;
  min-width: 150px;
  background: var(--file-bg);
  border-top: 2px solid var(--file-border-h);
  border-left: 2px solid var(--file-border-h);
  border-right: 2px solid var(--file-border-l);
  border-bottom: 2px solid var(--file-border-l);
  margin: 4px 0 4px 6px;
  overflow-y: auto;
  overflow-x: auto;
  flex-shrink: 0;
  color: var(--file-text);
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  color: var(--file-text);
}

.tree-item:hover  { background: var(--blue-sel); color: #fff; }
.tree-item.selected { background: var(--blue-sel); color: #fff; }
.tree-item .ti { font-size: 16px; flex-shrink: 0; }

.splitter {
  width: 5px;
  background: var(--gray);
  cursor: col-resize;
  flex-shrink: 0;
}

/* ── Bestandenlijst ── */
.file-panel {
  flex: 1;
  background: var(--file-bg);
  border-top: 2px solid var(--file-border-h);
  border-left: 2px solid var(--file-border-h);
  border-right: 2px solid var(--file-border-l);
  border-bottom: 2px solid var(--file-border-l);
  margin: 4px 6px 4px 0;
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--file-text);
}

.file-list-header {
  display: grid;
  grid-template-columns: 28px 324px 100px 120px 150px;
  background: var(--file-row-alt);
  border-bottom: 1px solid var(--file-border-l);
  position: sticky;
  top: 0;
}

.flh-cell {
  padding: 3px 8px;
  border-right: 2px solid var(--file-border-l);
  border-top: 2px solid var(--file-border-h);
  border-bottom: 2px solid var(--file-border-l);
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  font-size: 14px;
  color: var(--file-text);
}

.flh-cell:last-child { border-right: none; }

.file-row {
  display: grid;
  grid-template-columns: 28px 324px 100px 120px 150px;
  cursor: pointer;
  border-bottom: 1px solid var(--file-border-l);
  color: var(--file-text);
}

.file-row:hover   { background: #d5cfc8; color: var(--file-text); }
.file-row.selected { background: var(--blue-sel); color: #fff; }

.fr-cell {
  padding: 3px 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.fr-cell .fi { font-size: 16px; flex-shrink: 0; }

.cb-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.row-cb { cursor: pointer; width: 14px; height: 14px; accent-color: var(--blue-sel); }

/* ── Iconen weergave ── */
.file-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  align-content: flex-start;
}

.file-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  padding: 6px 4px;
  cursor: pointer;
  text-align: center;
  color: var(--file-text);
}

.file-icon:hover   { background: #d5cfc8; color: var(--file-text); }
.file-icon.selected { background: var(--blue-sel); color: #fff; }
.file-icon .big-icon { font-size: 32px; margin-bottom: 4px; }

.file-icon .icon-name {
  font-size: 12px;
  word-break: break-all;
  text-align: center;
  max-width: 76px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Thumbnails weergave ── */
.file-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  align-content: flex-start;
}

.file-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  padding: 4px;
  cursor: pointer;
  text-align: center;
  color: var(--file-text);
}

.file-thumb:hover   { background: #d5cfc8; color: var(--file-text); }
.file-thumb.selected { background: var(--blue-sel); color: #fff; }

.thumb-img {
  width: 112px;
  height: 84px;
  object-fit: cover;
  border: 2px solid var(--file-border-l);
  background: var(--file-bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.thumb-img img { width: 100%; height: 100%; object-fit: cover; }

.thumb-name {
  font-size: 11px;
  word-break: break-all;
  max-width: 116px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 3px;
}

/* ── Statusbalk ── */
.statusbar {
  display: flex;
  border-top: 1px solid var(--border-lo);
  padding: 3px 8px;
  background: var(--gray-mid);
}

.statusbar .sfield {
  border-top: 2px solid var(--file-border-h);
  border-left: 2px solid var(--file-border-h);
  border-right: 2px solid var(--file-border-l);
  border-bottom: 2px solid var(--file-border-l);
  padding: 2px 10px;
  flex: 1;
  margin-right: 4px;
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--file-text);
  background: var(--file-bg);
}

.statusbar .sfield:last-child { margin-right: 0; flex: 0 0 auto; min-width: 180px; }

/* ── Quota balk ── */
.quotabar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 13px;
  border-top: 1px solid var(--border-hi);
  background: var(--gray);
  color: var(--text);
}

.quota-track {
  flex: 1;
  height: 12px;
  background: #1a0a2e;
  max-width: 300px;
  border-top: 2px solid var(--inset-hi);
  border-left: 2px solid var(--inset-hi);
  border-right: 2px solid var(--inset-lo);
  border-bottom: 2px solid var(--inset-lo);
  overflow: hidden;
}

.quota-fill { height: 100%; background: var(--blue-sel); transition: width 0.3s; }
.quota-fill.warn { background: #9b1c1c; }

/* ── Login venster ── */
#login-win { background: var(--gray); width: 380px; }

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
}

.form-row label { width: 110px; text-align: right; font-size: 15px; color: var(--text); }

.win-input {
  flex: 1;
  background: #1a0a2e;
  border-top: 2px solid var(--inset-hi);
  border-left: 2px solid var(--inset-hi);
  border-right: 2px solid var(--inset-lo);
  border-bottom: 2px solid var(--inset-lo);
  padding: 3px 6px;
  font-family: "MS Sans Serif","Arial",sans-serif;
  font-size: 15px;
  outline: none;
  color: var(--text);
}

.win-input::placeholder { color: var(--text-dim); }

.win-select {
  flex: 1;
  background: #1a0a2e;
  border-top: 2px solid var(--inset-hi);
  border-left: 2px solid var(--inset-hi);
  border-right: 2px solid var(--inset-lo);
  border-bottom: 2px solid var(--inset-lo);
  padding: 3px 6px;
  font-family: "MS Sans Serif","Arial",sans-serif;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  color: var(--text);
}

.form-btns { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; }

/* ── Dialogen ── */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.dialog {
  background: var(--gray);
  min-width: 320px;
  max-width: 480px;
  color: var(--text);
}

.dialog-body { padding: 14px 18px; font-size: 15px; color: var(--text); }
.dialog-btns { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 14px 12px; }

.progress-track {
  height: 20px;
  background: #1a0a2e;
  border-top: 2px solid var(--inset-hi);
  border-left: 2px solid var(--inset-hi);
  border-right: 2px solid var(--inset-lo);
  border-bottom: 2px solid var(--inset-lo);
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: var(--blue-sel);
  transition: width 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
}

/* ── Tekst viewer ── */
.tekst-viewer-dialog {
  min-width: 600px;
  max-width: 90vw;
  width: 70vw;
}

.tekst-viewer-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 70vh;
}

.tekst-viewer-pre {
  flex: 1;
  overflow: auto;
  margin: 8px;
  padding: 8px;
  background: var(--file-bg-dark);
  border-top: 2px solid var(--file-border-h);
  border-left: 2px solid var(--file-border-h);
  border-right: 2px solid var(--file-border-l);
  border-bottom: 2px solid var(--file-border-l);
  font-family: "Courier New", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  color: var(--file-text);
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--gray); }
::-webkit-scrollbar-thumb {
  background: var(--gray-mid);
  border-top: 2px solid var(--border-hi);
  border-left: 2px solid var(--border-hi);
  border-right: 2px solid var(--border-lo);
  border-bottom: 2px solid var(--border-lo);
}
::-webkit-scrollbar-button {
  background: var(--gray-mid);
  display: block;
  height: 16px;
  width: 16px;
  border-top: 2px solid var(--border-hi);
  border-left: 2px solid var(--border-hi);
  border-right: 2px solid var(--border-lo);
  border-bottom: 2px solid var(--border-lo);
}

.file-panel.dragover { background: #ddd5f0; outline: 3px dashed var(--blue-sel); }
#upload-input { display: none; }
.hidden { display: none !important; }

/* ── Image viewer ── */
.img-viewer-dialog {
  min-width: 600px;
  max-width: 90vw;
  width: 70vw;
}

.img-viewer-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  max-height: 70vh;
  background: var(--file-bg-dark);
}

.img-viewer-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  touch-action: pinch-zoom;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  body { font-size: 13px; }
  .window { min-width: 0; max-width: 100vw; width: 100vw; }
  #login-win { width: 95vw; }
  
  /* Titlebar */
  .titlebar { font-size: 13px; padding: 2px 2px 2px 4px; }
  .titlebar .winbtn { width: 18px; height: 16px; font-size: 10px; }
  .lang-btn { font-size: 10px; padding: 0 4px; }
  
  /* Toolbar & Actionbar */
  .toolbar, .actionbar { padding: 4px; gap: 3px; }
  .toolbar .sep, .actionbar .sep { height: 20px; }
  .btn { font-size: 13px; padding: 3px 6px; min-width: 28px; }
  
  /* Adressbalk */
  .addrbar-left { width: 60px; min-width: 60px; font-size: 13px; padding: 3px 4px; }
  .addrbar-right { padding: 3px 4px; }
  .zoek-input { font-size: 13px; padding: 2px 4px; }
  
  /* Hoofdpaneel - tree en preview verbergen op mobiel */
  .main-panel { height: calc(100vh - 180px); min-height: 300px; }
  .tree-panel { display: none; }
  .preview-panel { display: none; }
  .splitter { display: none; }
  
  /* File panel volle breedte */
  .file-panel { margin: 4px; }
  
  /* Bestandenlijst - checkbox, naam, grootte */
  .file-list-header { grid-template-columns: 24px 1fr 70px; }
  .file-row { grid-template-columns: 24px 1fr 70px; }
  .flh-cell { font-size: 11px; padding: 2px 4px; }
  .fr-cell { font-size: 11px; padding: 2px 4px; gap: 3px; }
  
  /* Verberg type en datum kolommen */
  .flh-cell:nth-child(4), .flh-cell:nth-child(5) { display: none; }
  .fr-cell:nth-child(4), .fr-cell:nth-child(5) { display: none; }
  
  /* Statusbalk */
  .statusbar { padding: 2px 4px; flex-wrap: wrap; }
  .statusbar .sfield { font-size: 11px; padding: 2px 6px; margin-bottom: 2px; }
  .statusbar .sfield:last-child { min-width: 100%; }
  
  /* Quota */
  .quotabar { font-size: 11px; padding: 3px 4px; }
  .quota-track { max-width: 200px; height: 10px; }
  
  /* Forms */
  .form-row { padding: 5px 10px; }
  .form-row label { width: 70px; font-size: 13px; }
  .win-input, .win-select { font-size: 13px; padding: 3px 5px; }
  .form-btns { padding: 8px 10px; }
  
  /* Dialogen */
  .dialog-overlay { padding: 10px; }
  .dialog { min-width: 90vw; max-width: calc(100vw - 20px); }
  .dialog-body { font-size: 13px; padding: 12px 14px; }
  .tekst-viewer-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
  .tekst-viewer-body { height: 60vh; }
  .tekst-viewer-pre { font-size: 12px; }
  .img-viewer-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
  .img-viewer-body { min-height: 50vh; max-height: 60vh; }
  .img-viewer-body img { max-height: 60vh; }
  
  /* Iconen en thumbnails blijven werken */
  .file-icons { gap: 6px; padding: 6px; }
  .file-icon { width: 70px; padding: 4px 2px; }
  .file-icon .big-icon { font-size: 28px; }
  .file-icon .icon-name { font-size: 11px; max-width: 66px; }
  
  .file-thumbs { gap: 6px; padding: 6px; }
  .file-thumb { width: 100px; }
  .thumb-img { width: 92px; height: 69px; }
  .thumb-name { font-size: 10px; max-width: 96px; }
}
