/* ==========================================================================
   Ostprod — File Browser theme (v2.63.x)
   Pure CSS, self-hosted icon font (img/fonts/), no external requests.
   Works on top of the native "dark" theme by redefining its CSS variables,
   then adds targeted modern touches.
   Previous theme.park version: ../filebrowser-branding-backups/
   ========================================================================== */

/* ==========================================================================
   >>> COULEUR D'ACCENT — c'est ici qu'on la change <<<
   Remplace les 2 valeurs ci-dessous, enregistre, puis recharge la page
   (Ctrl+F5). Tout le reste (survol, sélection, focus…) en découle.

   Préréglages (accent / texte sur l'accent) :
     Ambre doux (défaut) ...... #d6a24e / #1a1408
     Or Ostprod d'origine ..... #e5a00d / #17130a
     Sable .................... #c9b48a / #1a160d
     Bleu acier ............... #6c9bd2 / #0b1520
     Indigo ................... #8b8cf0 / #0f0f24
     Vert sauge ............... #6fb59a / #0b1a14
     Corail ................... #e0846a / #200d07
     Neutre (blanc cassé) ..... #e4e4e7 / #111113
   ========================================================================== */
:root,
:root.dark,
.dark {
  --ost-accent: #d6a24e;
  --ost-on-accent: #1a1408;
}

/* ---------- 1. Design tokens ---------------------------------------------- */
:root,
:root.dark,
.dark {
  --ost-accent-hover: color-mix(in oklab, var(--ost-accent) 82%, white);
  --ost-radius: 12px;
  --ost-radius-sm: 8px;
  --ost-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
  --ost-ring: 0 0 0 3px color-mix(in srgb, var(--ost-accent) 35%, transparent);
  --ost-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* native File Browser variables */
  --blue: var(--ost-accent);
  --dark-blue: var(--ost-accent-hover);
  --background: #0f1012;
  --surfacePrimary: #18191c;
  --surfaceSecondary: #232428;
  --textPrimary: rgba(255, 255, 255, .62);
  --textSecondary: rgba(255, 255, 255, .92);
  --divider: rgba(255, 255, 255, .07);
  --hover: rgba(255, 255, 255, .06);
  --borderPrimary: rgba(255, 255, 255, .07);
  --borderSecondary: rgba(255, 255, 255, .16);
  --iconPrimary: #fff;
  --iconSecondary: var(--ost-on-accent);
  --iconTertiary: rgba(255, 255, 255, .55);
  --action: rgba(255, 255, 255, .85);
  --input-red: #4a1f1f;
  --input-green: #16402a;
  --dividerPrimary: rgba(0, 0, 0, .55);
  --dividerSecondary: rgba(0, 0, 0, .7);
}

/* ---------- Icons: Material Symbols Rounded (self-hosted) ----------------- */
@font-face {
  font-family: "Material Symbols Rounded";
  font-style: normal;
  font-weight: 300 500;
  font-display: block;
  src: url(/static/img/fonts/material-symbols-rounded.woff2) format("woff2");
}
.material-icons {
  font-family: "Material Symbols Rounded" !important;
  font-weight: normal;
  font-style: normal;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
}
header .material-icons,
nav .material-icons { font-variation-settings: "FILL" 0, "wght" 350, "GRAD" 0, "opsz" 24; }

/* ---------- 2. Base ------------------------------------------------------- */
html { background: var(--background); color-scheme: dark; }
body {
  font-family: var(--ost-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--ost-accent) 6%, transparent), transparent 60%),
    var(--background);
  background-attachment: fixed;
}
::selection { background: color-mix(in srgb, var(--ost-accent) 35%, transparent); color: #fff; }
a, .link { color: var(--ost-accent); }
a:hover, .link:hover { color: var(--ost-accent-hover); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .22); }
* { scrollbar-color: rgba(255, 255, 255, .15) transparent; }

:focus-visible { outline: none; box-shadow: var(--ost-ring); border-radius: var(--ost-radius-sm); }

/* ---------- 3. Header ----------------------------------------------------- */
header {
  background: rgba(15, 16, 18, .72);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--divider);
  box-shadow: none;
}
header img { height: 2.25em; width: auto; object-fit: contain; }
header .action { border-radius: 10px; transition: background .15s, color .15s; }
header .action:hover { background: var(--hover); }

#search #input {
  background: var(--surfaceSecondary);
  border: 1px solid var(--borderPrimary);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
#search #input:focus-within { border-color: color-mix(in srgb, var(--ost-accent) 60%, transparent); box-shadow: var(--ost-ring); }
#search #input input::placeholder { color: var(--textPrimary); }
#search.active #input { background: var(--surfacePrimary); border-radius: 0; box-shadow: none; }
#search #result { background: var(--background); }
#search .boxes {
  background: var(--surfacePrimary);
  border: 1px solid var(--borderPrimary);
  border-radius: var(--ost-radius);
  box-shadow: none;
  padding: 1em;
}
#search .boxes > div > div {
  background: var(--surfaceSecondary);
  border: 1px solid var(--borderPrimary);
  border-radius: var(--ost-radius-sm);
  color: var(--textSecondary);
  transition: background .15s, border-color .15s, transform .15s;
}
#search .boxes > div > div:hover {
  background: color-mix(in srgb, var(--ost-accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--ost-accent) 40%, transparent);
  transform: translateY(-1px);
}
#search .boxes i { color: var(--ost-accent) !important; }

/* ---------- 4. Sidebar ---------------------------------------------------- */
nav { padding: .75em .75em 0; box-sizing: border-box; }
nav > div { border-top: 1px solid var(--divider); padding-top: .5em; margin-top: .5em; }
nav > div:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
nav .action {
  border-radius: 10px;
  padding: .6em .75em;
  font-size: .95em;
  font-weight: 500;
  color: var(--textPrimary);
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
nav .action:hover { background: var(--hover); color: var(--textSecondary); }
nav .action i { color: var(--iconTertiary); margin-right: .35em; transition: color .15s; }
nav .action:hover i { color: var(--ost-accent); }

/* disk usage bar */
nav .credits {
  color: var(--textPrimary);
  font-size: .8em;
  width: auto !important;
  margin: 1.5em .75em !important;
}
nav .vue-simple-progress {
  background: var(--surfaceSecondary) !important;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: .25em;
}
nav .vue-simple-progress-bar { background: var(--ost-accent) !important; border-radius: 4px; }
.progress div { background-color: var(--ost-accent); }

/* ---------- 5. Breadcrumbs ------------------------------------------------ */
.breadcrumbs {
  background: rgba(15, 16, 18, .8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
}
.breadcrumbs a { border-radius: 8px; padding: .25em .5em; color: var(--textPrimary); }
.breadcrumbs a:hover { background: var(--hover); color: var(--textSecondary); }
.breadcrumbs span:last-child a { color: var(--textSecondary); font-weight: 600; }

/* ---------- 6. Listing ---------------------------------------------------- */
#listing h2 {
  color: var(--textPrimary);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72em;
  font-weight: 600;
  margin: 1.25em 0 .5em .75em;
}
#listing .item { transition: background .12s, border-color .12s, transform .12s, box-shadow .12s; }
#listing .item .name { font-weight: 500; color: var(--textSecondary); }
#listing .item .size,
#listing .item .modified { color: var(--textPrimary); font-variant-numeric: tabular-nums; }

/* file-type icons: filled glyph on a soft tinted tile */
#listing .item i {
  color: #a1a1aa;
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}
#listing .item[data-dir=true] i { color: var(--ost-accent); }
#listing .item[data-type=image] i { color: #5bbf8f; }
#listing .item[data-type=video] i { color: #e26d6d; }
#listing .item[data-type=audio] i { color: #a593f0; }
#listing .item[data-type=pdf] i { color: #e8875a; }
#listing .item[data-type=text] i,
#listing .item[data-type=textImmutable] i { color: #6aa8e8; }
#listing .item img { border-radius: 8px; }

#listing.list .item:not(.header) div:first-of-type i,
#listing.mosaic .item div:first-of-type i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, currentColor 13%, transparent);
  border-radius: 10px;
  margin: 0;
}
#listing.list .item:not(.header) div:first-of-type i { width: 34px; height: 34px; font-size: 20px; }
#listing.list .item div:first-of-type img { width: 34px; height: 34px; }
#listing.list .item:not(.header) div:first-of-type { width: 3.25em; }
#listing.mosaic:not(.gallery) .item div:first-of-type i { width: 48px; height: 48px; font-size: 26px; border-radius: 12px; }
#listing.mosaic:not(.gallery) .item div:first-of-type img { width: 48px; height: 48px; }
#listing.mosaic.gallery .item div:first-of-type {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .02);
}
#listing.mosaic.gallery .item div:first-of-type i { width: 84px; height: 84px; font-size: 44px; border-radius: 20px; }

/* list view */
#listing.list {
  background: var(--surfacePrimary);
  border: 1px solid var(--borderPrimary);
  border-radius: var(--ost-radius);
  overflow: clip;
  margin-top: 1em;
}
#listing.list .item {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--divider);
  padding: .7em 1em;
}
#listing.list .item:hover { background: var(--hover); }
#listing.list .item.header {
  background: var(--surfacePrimary);
  border-bottom: 1px solid var(--borderPrimary);
  padding: .65em 1em;
}
#listing.list .item.header,
#listing.list .item.header p,
#listing.list .item.header span {
  color: var(--textPrimary);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
}
#listing.list .item.header .active,
#listing.list .item.header .active i { color: var(--ost-accent); }
#listing.list .item.header i { font-size: 1.1em; }

/* mosaic / gallery view */
#listing.mosaic .item {
  background: var(--surfacePrimary);
  border: 1px solid var(--borderPrimary);
  border-radius: var(--ost-radius);
  box-shadow: none !important;
}
#listing.mosaic .item:hover {
  background: var(--surfaceSecondary);
  border-color: var(--borderSecondary);
  transform: translateY(-2px);
  box-shadow: var(--ost-shadow) !important;
}
#listing.mosaic.gallery .item { overflow: hidden; padding: 0; }
#listing.mosaic.gallery .item div:first-of-type { height: 12em; }
#listing.mosaic.gallery .item img { border-radius: 0; }
#listing.mosaic.gallery .item div:last-of-type { bottom: 0; width: 100%; box-sizing: border-box; }

/* selection */
#listing .item[aria-selected=true] {
  background: color-mix(in srgb, var(--ost-accent) 16%, transparent) !important;
  color: var(--textSecondary) !important;
  border-color: color-mix(in srgb, var(--ost-accent) 45%, transparent) !important;
}
#listing .item[aria-selected=true] i { color: var(--ost-accent) !important; }
#listing.list .item[aria-selected=true] { box-shadow: inset 3px 0 0 var(--ost-accent); }

#listing #multiple-selection {
  background: var(--surfaceSecondary);
  border-top: 1px solid var(--borderSecondary);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .35);
}
#listing #multiple-selection p,
#listing #multiple-selection i { color: var(--textSecondary); }

/* drag & drop target */
#listing .item.drop,
.dragging #listing { outline: 2px dashed color-mix(in srgb, var(--ost-accent) 60%, transparent); outline-offset: -2px; }

/* empty folder */
#listing ~ h2.message,
h2.message { color: var(--textPrimary); font-weight: 500; }
h2.message i { color: rgba(255, 255, 255, .18); }

/* ---------- 7. Cards & dialogs -------------------------------------------- */
.card {
  background: var(--surfacePrimary);
  border: 1px solid var(--borderPrimary);
  border-radius: var(--ost-radius);
  box-shadow: none;
}
.card.floating {
  background: #1b1c20;
  border-color: var(--borderSecondary);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  animation: ost-pop .16s ease-out;
}
.card .card-title h2 { font-size: 1.15em; font-weight: 600; }
.card h3 { color: var(--textPrimary); }
.overlay {
  background-color: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.card .card-action.full .action {
  border: 1px solid var(--borderPrimary);
  border-radius: var(--ost-radius-sm);
  transition: background .15s, border-color .15s;
}
.card .card-action.full .action:hover {
  background: color-mix(in srgb, var(--ost-accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--ost-accent) 40%, transparent);
}
.card#share ul li a { color: var(--ost-accent); }
.card#share .action.copy-clipboard:after { background: var(--ost-accent); color: var(--ost-on-accent); }
.card-content table th { color: var(--textPrimary); font-weight: 600; }

@keyframes ost-pop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.98); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.upload-files .card.floating { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .card.floating { animation: none; }
  #listing .item { transition: none; }
  #listing.mosaic .item:hover { transform: none; }
}

/* ---------- 8. Buttons & inputs ------------------------------------------ */
.button {
  background: var(--ost-accent);
  color: var(--ost-on-accent);
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: none;
  font-weight: 600;
  padding: .55em 1.1em;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.button:hover { background: var(--ost-accent-hover); }
.button:active { transform: translateY(1px); }
.button:focus-visible { box-shadow: var(--ost-ring); }
.button--red { background: #e5484d; color: #fff; }
.button--red:hover { background: #ec5d5e; }
.button--flat {
  background: transparent;
  color: var(--ost-accent);
  text-transform: none;
  font-weight: 600;
}
.button--flat:hover { background: var(--hover); }
.button--flat.button--red { background: transparent; color: #ff6369; }
.button--flat.button--red:hover { background: rgba(229, 72, 77, .12); }
.button--flat.button--grey { color: var(--textPrimary); }

.input,
.card#share input,
.card#share select,
select.input {
  background: var(--background);
  color: var(--textSecondary);
  border: 1px solid var(--borderSecondary);
  border-radius: 10px;
  padding: .6em .9em;
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: rgba(255, 255, 255, .25); }
.input:focus { border-color: color-mix(in srgb, var(--ost-accent) 70%, transparent); box-shadow: var(--ost-ring); outline: none; }
.input::placeholder { color: rgba(255, 255, 255, .35); }
select > option { background: var(--surfaceSecondary); color: var(--textSecondary); }
input[type=checkbox], input[type=radio] { accent-color: var(--ost-accent); }

/* ---------- 9. Login ------------------------------------------------------ */
#login {
  background:
    radial-gradient(900px 500px at 50% -10%, color-mix(in srgb, var(--ost-accent) 14%, transparent), transparent 70%),
    var(--background);
}
#login form {
  background: rgba(24, 25, 28, .85);
  border: 1px solid var(--borderSecondary);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
  padding: 2.25em 2em 2em;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
#login img { height: 4.5em; width: auto; margin-bottom: .25em; }
#login h1 { font-weight: 700; letter-spacing: -.01em; color: var(--textSecondary); }
#login input[type=text],
#login input[type=password] { margin-bottom: .75em; }
#login .button { width: 100%; padding: .75em 1em; margin-top: .25em; }
#login .wrong {
  background: rgba(229, 72, 77, .15);
  color: #ff8a8e;
  border: 1px solid rgba(229, 72, 77, .35);
  border-radius: 10px;
}

/* ---------- 10. Settings / dashboard -------------------------------------- */
.dashboard #nav .wrapper { border-bottom: 1px solid var(--divider); }
.dashboard #nav ul li { border-radius: 10px 10px 0 0; }
.dashboard #nav ul li:hover { background: var(--hover); }
.dashboard #nav ul li.active { border-color: var(--ost-accent); color: var(--ost-accent); }
.dashboard #nav ul li.active:before { background: var(--ost-accent); }
.card-content table tr:hover td { background: var(--hover); }

/* ---------- 11. Public share page ----------------------------------------- */
.share { padding-top: 1.5em; gap: 1.25em; align-items: flex-start; }
.share__box {
  background: var(--surfacePrimary);
  border: 1px solid var(--borderPrimary);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 20px 50px rgba(0, 0, 0, .35);
  margin: 0;
}
/* single file share: one centred card */
.share__box__info:only-child {
  flex: 0 1 30em;
  margin: 2vh auto 0;
  position: static !important;
}
.share__box__header {
  height: auto !important;
  padding: 1.5em 1.5em .25em;
  color: var(--textPrimary);
  font-size: .72em;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.share__box__element {
  border-top: 0;
  padding: .55em 1.75em;
  height: auto !important;
  color: var(--textSecondary);
  word-break: break-word;
}
.share__box__element strong {
  display: block;
  color: var(--textPrimary);
  font-size: .72em;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .2em;
}
/* file icon */
.share__box__element.share__box__icon { padding: 1em 1.75em .75em; }
.share__box__icon i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  font-size: 54px !important;
  border-radius: 24px;
  color: var(--ost-accent);
  background: color-mix(in srgb, var(--ost-accent) 13%, transparent);
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 48;
}
/* the first info line = file name: give it the spotlight */
.share__box__icon + .share__box__element {
  text-align: center;
  font-size: 1.2em;
  font-weight: 600;
  padding-bottom: .9em;
  border-bottom: 1px solid var(--divider);
  margin-bottom: .5em;
}
.share__box__icon + .share__box__element strong { display: none; }
/* actions */
.share__box__element.share__box__center:has(.button) {
  display: flex;
  flex-wrap: wrap;
  gap: .6em;
  justify-content: center;
  padding: 1.1em 1.75em .5em;
}
.share__box__element .button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 1 1 10em;
  height: auto !important;
  margin: 0;
  padding: .8em 1.1em;
  border-radius: 12px;
  font-size: .95em;
  font-weight: 600;
  text-transform: none;
  background: var(--surfaceSecondary);
  color: var(--textSecondary);
  border: 1px solid var(--borderSecondary);
}
.share__box__element .button:hover { background: #2c2d32; color: #fff; }
.share__box__element .button:first-child {
  background: var(--ost-accent);
  color: var(--ost-on-accent);
  border-color: transparent;
}
.share__box__element .button:first-child:hover { background: var(--ost-accent-hover); }
.share__box__element .button > div { display: inline-flex; align-items: center; gap: .5em; }
.share__box__element .button i {
  display: inline-block !important;
  margin: 0 !important;
  font-size: 1.25em;
  color: inherit !important;
}
/* QR code: small, tidy, labelled */
.share__box__element.share__box__center:has(> canvas) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6em;
  padding: 1em 1.75em 1.75em;
}
.share__box__element.share__box__center:has(> canvas)::before {
  content: "Ou scannez pour ouvrir sur mobile";
  color: var(--textPrimary);
  font-size: .78em;
}
.share__box__element canvas {
  width: 116px !important;
  height: 116px !important;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
}
/* folder share: download button + QR side by side */
.share__box__element.share__box__center:has(.button):has(canvas) {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 1em;
}
.share__box__element.share__box__center:has(.button):has(canvas)::before { content: none; }
.share__box__element.share__box__center:has(.button):has(canvas) .button { flex: 1 1 8em; }
.share__box__element.share__box__center:has(.button):has(canvas) canvas { flex: 0 0 auto; width: 96px !important; height: 96px !important; }
/* folder share: file list */
.share__box__items { flex: 10 0 25em; overflow: hidden; }
.share__box__items .share__box__header { text-align: left; padding: 1.4em 1.5em .9em; }
.share__box__items #listing.list { margin-top: 0; border: 0; border-radius: 0; background: transparent; }
.share__box__items #listing.list .item { border-top: 1px solid var(--divider); border-bottom: 0; padding: .65em 1.5em; }
.share__wrong__password { background: #e5484d; border-radius: 10px; }
@media (max-width: 736px) {
  .share { padding: .75em 0 0; }
  .share__box__info:only-child { flex-basis: 100%; margin-top: 0; }
  .share__box__element { padding-left: 1.25em; padding-right: 1.25em; }
}

/* ---------- 12. Uploads, shell, editor, previewer ------------------------- */
.upload-files .file .file-progress { background: var(--surfaceSecondary); border-radius: 10px; overflow: hidden; }
.upload-files .file .file-progress div { background-color: var(--ost-accent); }
.upload-files .card.floating { border-radius: 14px 0 0 0; }

.shell { background: #0b0c0e; }
.shell__prompt i { color: var(--ost-accent); }
.shell__content { font-family: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace; }

#editor-container { background: var(--background); }
#previewer { background-color: rgba(8, 8, 10, .96); }
#previewer header { background: rgba(8, 8, 10, .6); border-bottom-color: transparent; }

/* ---------- 13. Mobile ---------------------------------------------------- */
@media (max-width: 736px) {
  nav {
    background: var(--surfacePrimary);
    border-right: 1px solid var(--borderPrimary);
    padding: .75em;
  }
  #dropdown {
    background: var(--surfaceSecondary);
    border: 1px solid var(--borderSecondary);
    border-radius: var(--ost-radius);
    box-shadow: var(--ost-shadow);
  }
  #listing.list { border-radius: 10px; }
  #login form { margin: 0 1em; padding: 1.75em 1.25em 1.5em; }
}
