/* Veedo Space: File Browser in veedo's look (tokens from veedo studio/web/css/tokens.css). Served as /static/custom.css
   from /srv/veedo-space/branding; fonts and logo under img/ (the only branding path File Browser serves). */

@font-face {
  font-family: "Vazirmatn";
  src: url("img/fonts/Vazirmatn-VF.woff2") format("woff2-variations"), url("img/fonts/Vazirmatn-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Estedad";
  src: url("img/fonts/Estedad-VF.woff2") format("woff2-variations"), url("img/fonts/Estedad-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---- tokens: light ---- */
:root {
  --vd-bg: #f9fafb;
  --vd-surface: #ffffff;
  --vd-surface-2: #f3f4f7;
  --vd-surface-3: #ebedf0;
  --vd-surface-4: #e1e3e7;
  --vd-line: #10121817;
  --vd-line-strong: #10121829;
  --vd-text-3: #60636a;
  --vd-text-2: #4c5058;
  --vd-text-1: #17191f;
  --vd-accent: #ea6a09;
  --vd-accent-hover: #dd5f02;
  --vd-accent-press: #d45b10;
  --vd-on-accent: #1c0d06;
  --vd-accent-text: #ab4501;
  --vd-accent-soft: #fee8d7;
  --vd-focus: #b44901;
  --vd-danger: #be2e31;
  --vd-danger-soft: #fee9e8;
  --vd-success-soft: #def6e3;
  --vd-scrim: #111318a3;
  --vd-shadow-pop: 0 8px 24px #1a1d2414, 0 2px 6px #1a1d240f;
  --vd-shadow-modal: 0 24px 64px #1a1d2426, 0 4px 12px #1a1d2414;
  --vd-highlight: inset 0 1px 0 0 #ffffff47;
  --vd-glow: 0 6px 18px -4px #ea6a0959;

  --vd-font-sans: "Vazirmatn", system-ui, "Segoe UI", Tahoma, sans-serif;
  --vd-font-display: "Estedad", "Vazirmatn", system-ui, sans-serif;
  --vd-gradient-signature: linear-gradient(120deg, #f2470b 0%, #fc9417 52%, #f4d576 100%);
  --vd-radius-sm: 10px;
  --vd-radius-md: 12px;
  --vd-radius-lg: 20px;
  --vd-radius-2xl: 28px;
  --vd-radius-full: 9999px;

  /* File Browser's own variables, mapped */
  --blue: var(--vd-accent);
  --dark-blue: var(--vd-accent-press);
  --red: var(--vd-danger);
  --dark-red: var(--vd-danger);
  --icon-blue: var(--vd-accent);
  --iconPrimary: var(--vd-accent);
  --iconSecondary: #fff;
  --iconTertiary: var(--vd-text-3);
  --action: var(--vd-text-2);
  --background: var(--vd-bg);
  --surfacePrimary: var(--vd-surface);
  --surfaceSecondary: var(--vd-surface-3);
  --textPrimary: var(--vd-text-2);
  --textSecondary: var(--vd-text-1);
  --divider: var(--vd-line);
  --hover: var(--vd-surface-3);
  --borderPrimary: var(--vd-line);
  --borderSecondary: var(--vd-line-strong);
  --item-selected: var(--vd-accent-soft);
  --input-red: var(--vd-danger-soft);
  --input-green: var(--vd-success-soft);
}

/* ---- tokens: dark (File Browser sets :root.dark) ---- */
:root.dark {
  --vd-bg: #08090b;
  --vd-surface: #0f1013;
  --vd-surface-2: #16171b;
  --vd-surface-3: #1e1f24;
  --vd-surface-4: #292a30;
  --vd-line: #ffffff14;
  --vd-line-strong: #ffffff24;
  --vd-text-3: #9c9ea4;
  --vd-text-2: #b8bac0;
  --vd-text-1: #eff0f3;
  --vd-accent: #f88736;
  --vd-accent-hover: #fd9a4c;
  --vd-accent-press: #eb762f;
  --vd-on-accent: #211209;
  --vd-accent-text: #fc9f59;
  --vd-accent-soft: #26180f;
  --vd-focus: #ff9b4e;
  --vd-danger: #f97676;
  --vd-danger-soft: #401a1a;
  --vd-success-soft: #142d1b;
  --vd-scrim: #050608b8;
  --vd-shadow-pop: 0 8px 24px #00000066, 0 2px 6px #00000052;
  --vd-shadow-modal: 0 24px 64px #0000008c, 0 4px 12px #00000066;
  --vd-highlight: inset 0 1px 0 0 #ffffff0f;
  --vd-glow: 0 6px 18px -4px #f8873659;

  --blue: var(--vd-accent);
  --dark-blue: var(--vd-accent-press);
  --red: var(--vd-danger);
  --dark-red: var(--vd-danger);
  --action: var(--vd-text-2);
  --background: var(--vd-bg);
  --surfacePrimary: var(--vd-surface);
  --surfaceSecondary: var(--vd-surface-3);
  --textPrimary: var(--vd-text-2);
  --textSecondary: var(--vd-text-1);
  --divider: var(--vd-line);
  --hover: var(--vd-surface-3);
  --borderPrimary: var(--vd-line);
  --borderSecondary: var(--vd-line-strong);
  --iconPrimary: var(--vd-accent);
  --iconSecondary: #fff;
  --iconTertiary: var(--vd-text-3);
  --item-selected: var(--vd-accent-soft);
  --input-red: var(--vd-danger-soft);
  --input-green: var(--vd-success-soft);
  --dividerPrimary: var(--vd-scrim);
  --dividerSecondary: var(--vd-scrim);
}

/* ---- type ---- */
body, input, button, select, textarea, .input, .button {
  font-family: var(--vd-font-sans);
}
body {
  background: var(--vd-bg);
  color: var(--vd-text-1);
  font-size: 14px;
  line-height: 1.6;
}
h1, h2, h3, .card-title h2, #login h1 {
  font-family: var(--vd-font-display);
}
::selection { background: var(--vd-accent-soft); color: var(--vd-text-1); }
:focus-visible { outline: 2px solid var(--vd-focus); outline-offset: 2px; }

/* ---- top bar ---- */
header {
  background: var(--vd-bg);
  border-bottom: 1px solid var(--vd-line);
  box-shadow: none;
  padding-inline: 16px 12px;
  gap: 4px;
}
header img {
  height: 2.2em;
  margin-inline: 0 12px !important;
}
#search #input {
  background: var(--vd-surface-2);
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-full);
  height: 40px;
  margin-block: 2px;
  padding-inline: 14px;
  color: var(--vd-text-2);
}
#search #input:focus-within { border-color: var(--vd-line-strong); background: var(--vd-surface-3); }
#search #input input { color: var(--vd-text-1); }
#search #input input::placeholder { color: var(--vd-text-3); }
#search #input > i { color: var(--vd-text-3); margin-inline: 0 8px; }
#search.active #input { border-radius: 0; height: 4em; margin: 0; background: var(--vd-surface); }
#search .boxes { border: 1px solid var(--vd-line); border-radius: var(--vd-radius-lg); box-shadow: none; padding: 8px; }
#search .boxes > div > div {
  background: var(--vd-surface-3);
  color: var(--vd-text-1);
  border-radius: var(--vd-radius-md);
}
#search .boxes i { color: var(--vd-accent) !important; }

/* round icon buttons, as veedo's top bar */
.action {
  color: var(--vd-text-2);
  border-radius: var(--vd-radius-full);
  transition: background .12s, color .12s;
}
.action:hover { background: var(--vd-surface-3); color: var(--vd-text-1); }
header .action { width: 40px; height: 40px; padding: 0; margin: 0; }
header .action i { font-size: 22px; vertical-align: middle; }
#upload-button { background: var(--vd-accent); color: var(--vd-on-accent); box-shadow: var(--vd-highlight), var(--vd-glow); margin-inline: 4px; }
#upload-button:hover { background: var(--vd-accent-hover); color: var(--vd-on-accent); }
#upload-button i { color: inherit; }

/* ---- side nav ---- */
nav {
  background: var(--vd-bg);
  border-inline-end: 1px solid var(--vd-line);
  padding: 12px 10px;
  box-sizing: border-box;
}
nav .action {
  border-radius: var(--vd-radius-md);
  padding: 8px 12px;
  margin-block: 2px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--vd-text-2);
}
nav .action i { font-size: 20px; color: var(--vd-text-3); }
nav .action span { padding: 0 !important; }
nav .action:hover i { color: var(--vd-text-1); }
nav .action:first-child { color: var(--vd-text-1); }
nav .action:first-child i { color: var(--vd-accent); }
nav > div { border-top: 1px solid var(--vd-line); margin-block: 8px; padding-block: 6px; }
nav .credits, .credits { color: var(--vd-text-3); font-size: 12px; margin-inline: 12px !important; width: auto !important; }
.vue-simple-progress { background: var(--vd-surface-4) !important; border-radius: var(--vd-radius-full); overflow: hidden; }
.vue-simple-progress-bar { background: var(--vd-accent) !important; border-radius: var(--vd-radius-full); }

/* ---- listing ---- */
.breadcrumbs {
  background: var(--vd-bg);
  border-bottom: 1px solid var(--vd-line);
  color: var(--vd-text-3);
}
.breadcrumbs a { border-radius: var(--vd-radius-sm); padding-inline: 6px; }
.breadcrumbs a:hover { background: var(--vd-surface-3); color: var(--vd-text-1); }
#listing h2 {
  color: var(--vd-text-3);
  font: 600 13px/22px var(--vd-font-sans);
  margin: 20px 4px 8px;
}
#listing .item {
  background: var(--vd-surface);
  border: 1px solid var(--vd-line) !important;
  color: var(--vd-text-2);
  box-shadow: none;
}
#listing .item:hover { background: var(--vd-surface-2); border-color: var(--vd-line-strong) !important; }
#listing .item[aria-selected="true"] {
  background: var(--vd-accent-soft) !important;
  border-color: var(--vd-accent) !important;
  color: var(--vd-text-1) !important;
}
#listing .item[aria-selected="true"] i { color: var(--vd-accent) !important; }
#listing .item .name { font-weight: 600; color: var(--vd-text-1); }
#listing .item .size, #listing .item .modified { color: var(--vd-text-3); font-size: 13px; }
#listing .item i { color: var(--vd-text-3); }
#listing .item[data-dir="true"] i { color: var(--vd-accent); }

/* list mode: rounded rows with a gap */
#listing.list { display: flex; flex-direction: column; gap: 6px; }
#listing.list > div { display: flex; flex-direction: column; gap: 6px; }
#listing.list .item { border-radius: var(--vd-radius-md); margin: 0; padding-block: 2px; }
#listing.list .item.header {
  background: transparent;
  border: 0 !important;
  border-radius: 0;
  color: var(--vd-text-3);
  font-size: 12px;
}
#listing.list .item.header:hover { background: transparent; }
#listing.list .item.header .active { color: var(--vd-text-1); }

/* grid modes: soft cards */
#listing.mosaic .item, #listing.gallery .item {
  border-radius: var(--vd-radius-lg);
  overflow: hidden;
}

/* empty folder */
#listing h2.message, h2.message { color: var(--vd-text-3); font-family: var(--vd-font-display); }
h2.message i { color: var(--vd-accent); }

/* ---- buttons and inputs ---- */
.button {
  background: var(--vd-accent);
  color: var(--vd-on-accent);
  border: 0;
  border-radius: var(--vd-radius-full);
  box-shadow: var(--vd-highlight), var(--vd-glow);
  font: 600 14px/24px var(--vd-font-sans);
  padding: 6px 18px;
}
.button:hover { background: var(--vd-accent-hover); }
.button--red { background: var(--vd-danger); color: #fff; box-shadow: none; }
.button--flat {
  background: transparent;
  color: var(--vd-text-1);
  box-shadow: none;
  text-transform: none;
}
.button--flat:hover { background: var(--vd-surface-3); }
.button--flat.button--red { color: var(--vd-danger); background: transparent; }
.button--flat.button--red:hover { background: var(--vd-danger-soft); }
.button--flat.button--grey { color: var(--vd-text-2); }
.input, select, input[type="text"], input[type="password"], input[type="number"] {
  background: var(--vd-surface-2);
  color: var(--vd-text-1);
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-md);
  padding: 8px 14px;
}
.input:hover, .input:focus { border-color: var(--vd-line-strong); }
.input:focus { background: var(--vd-surface-3); outline: none; box-shadow: 0 0 0 2px var(--vd-accent-soft); }

/* ---- cards, prompts and menus ---- */
.card {
  background: var(--vd-surface);
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-lg);
  box-shadow: none;
  color: var(--vd-text-1);
}
.card.floating {
  border-radius: var(--vd-radius-2xl);
  box-shadow: var(--vd-shadow-modal);
  padding: 4px;
}
.card .card-title h2 { font: 600 18px/30px var(--vd-font-display); color: var(--vd-text-1); }
.card .card-action { gap: 8px; }
.overlay { background: var(--vd-scrim) !important; backdrop-filter: blur(2px); }
#dropdown.active, .context-menu {
  background: var(--vd-surface-2);
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-lg);
  box-shadow: var(--vd-shadow-pop);
  padding: 6px;
}
.context-menu .action, #dropdown.active .action { border-radius: var(--vd-radius-sm); }
#multiple-selection {
  background: var(--vd-accent);
  color: var(--vd-on-accent);
  border-radius: var(--vd-radius-full);
  inset-inline: 50% auto;
  width: auto;
  min-width: 18em;
  bottom: 16px;
  padding: 4px 8px 4px 20px;
  box-shadow: var(--vd-shadow-pop);
}
#multiple-selection .action, #multiple-selection i { color: var(--vd-on-accent) !important; }

/* upload progress */
.upload-files .card, .upload-files.card { border-radius: var(--vd-radius-lg); }
.upload-files .file-progress, .upload-files .file-progress div { border-radius: var(--vd-radius-full); }
.upload-files .file-progress div { background: var(--vd-accent) !important; }

/* settings */
.dashboard #nav ul { border-radius: var(--vd-radius-full); border: 1px solid var(--vd-line); padding: 4px; display: inline-flex; gap: 4px; }
.dashboard #nav ul li { border-radius: var(--vd-radius-full); border: 0; padding: 6px 16px; }
.dashboard #nav .active li, .dashboard #nav ul li:hover { background: var(--vd-surface-3); color: var(--vd-text-1); }
.dashboard #nav .active li { border-bottom: 0 !important; color: var(--vd-accent-text); }
table th { color: var(--vd-text-3); font-weight: 600; }
table tr > * { border-color: var(--vd-line); }

/* ---- login ---- */
#login { background: var(--vd-bg); }
#login::before {
  content: "";
  position: fixed;
  inset: -20vh -20vw auto auto;
  width: 70vw;
  height: 70vh;
  background: radial-gradient(closest-side, #fc941733, transparent 70%);
  pointer-events: none;
}
#login form {
  background: var(--vd-surface);
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-2xl);
  box-shadow: var(--vd-shadow-modal);
  padding: 36px 32px 28px;
  max-width: 22em;
  width: calc(100% - 32px);
  box-sizing: border-box;
}
#login img { width: 72px; height: 72px; margin-bottom: 4px; }
#login h1 { font: 800 26px/40px var(--vd-font-display); color: var(--vd-text-1); margin: 0 0 20px; }
#login .input { margin-bottom: 10px; padding: 10px 16px; border-radius: var(--vd-radius-md); }
#login .button { margin-top: 8px; padding-block: 8px; }
#login .wrong { background: var(--vd-danger-soft); color: var(--vd-danger); border-radius: var(--vd-radius-md); }
#login p { color: var(--vd-text-3); }

/* ---- right-to-left (Persian) ----
   File Browser's own RTL shifts the breadcrumbs and listing with transforms and margins; lay the page out plainly
   instead: nav on the right, main on the left. */
@media (min-width: 737px) {
  html[dir="rtl"] main { margin: 0 auto 1em 1em; }
}
html[dir="rtl"] #listing,
html[dir="rtl"] .dashboard .row,
html[dir="rtl"] .dashboard #nav .wrapper { margin-right: 0; }
html[dir="rtl"] .breadcrumbs,
html[dir="rtl"] .breadcrumbs a { transform: none; }
html[dir="rtl"] .breadcrumbs .chevron { transform: scaleX(-1); }
html[dir="rtl"] nav .action { text-align: start; }
html[dir="rtl"] .credits { direction: ltr; text-align: right; }
/* English times and sizes inside Persian rows keep their own order */
#listing .item .modified, #listing .item .size, #listing .item .name, .credits span, .breadcrumbs a, .breadcrumbs span { unicode-bidi: plaintext; }
.card .card-action .button--flat:not(.button--grey):not(.button--red) { color: var(--vd-accent-text); }
.card .card-action .button--flat:not(.button--grey):not(.button--red):hover { background: var(--vd-accent-soft); }

/* scrollbars */
* { scrollbar-color: var(--vd-surface-4) transparent; scrollbar-width: thin; }
