/* /var/lib/filebrowser/branding/custom.css
   iOS-ish glass, consolidated vars, login + app + breadcrumbs + context menu
*/

:root {
  --bg-base: #0e1117;

  --glass-1: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.09);

  --stroke-1: rgba(255, 255, 255, 0.12);
  --stroke-2: rgba(255, 255, 255, 0.18);

  --text-0: rgba(255, 255, 255, 0.92);
  --text-1: rgba(255, 255, 255, 0.65);

  --accent: #0a84ff;

  --radius: 18px;
  --radius-2: 22px;
  --radius-lg: 26px;

  --shadow: 0 22px 70px rgba(0, 0, 0, 0.50);

  --crumb-bg: rgba(255, 255, 255, 0.0);
  --crumb-stroke: rgba(255, 255, 255, 0.10);
  --crumb-hover: rgba(255, 255, 255, 0.08);
}

html,
body {
  min-height: 100%;
  background:
    linear-gradient(rgba(10,10,15,0.60), rgba(10,10,15,0.60)),
    url("/static/img/background.webp") center / cover no-repeat fixed;

  color: var(--text-0) !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "SF Pro Display", system-ui, sans-serif !important;
}

a {
  color: inherit;
  text-decoration: none;
}

*:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white 30%);
  outline-offset: 2px;
  border-radius: 10px;
}

/* Login */
#login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

#login form {
  width: min(420px, 92vw);
  padding: 28px 26px 22px;
  background: var(--glass-2);
  border: 1px solid var(--stroke-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  text-align: center;
}

#login form img {
  width: 56px;
  height: 56px;
  margin: 2px auto 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--stroke-1);
  padding: 8px;
}

#login form h1 {
  margin: 0 0 18px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

#login input.input {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid var(--stroke-1) !important;
  border-radius: var(--radius) !important;
  color: var(--text-0) !important;
}

#login input.input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(10,132,255,0.20) !important;
  outline: none !important;
}

#login input.button.button--block {
  border-radius: var(--radius) !important;
  border: 1px solid rgba(10,132,255,0.45) !important;
  background: rgba(10,132,255,0.22) !important;
  color: var(--text-0) !important;
  margin-top: 8px;
  transition: background 0.15s ease, transform 0.08s ease;
}

#login input.button.button--block:hover {
  background: rgba(10,132,255,0.30) !important;
}

#login input.button.button--block:active {
  transform: translateY(1px);
}

/* App header */
header {
  background: transparent !important;
}

.dashboard > header,
main > .dashboard > header {
  background: transparent !important;
  border-bottom: 1px solid var(--stroke-1) !important;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.dashboard > header img {
  height: 22px;
  width: auto;
  opacity: 0.95;
}


/* Search */
#search {
  background: transparent !important;
}

#search #input {
  background: transparent !important;
}


/* Sidebar */
#nav {
  background: var(--glass-1) !important;
  border-right: 1px solid var(--stroke-1) !important;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

nav .action {
    width: 60%;
    display: block;
    font-size: 1.1em;
    padding: 0em;
    margin: 0.2em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 736px) {
    nav.active {
        left: 0px;
    }
}
@media (max-width: 736px) {
    nav {
        top: 59px;
        z-index: 99999;
        background: rgb(58 65 71 / 0%);
        height: 100%;
        width: 100%;
        box-shadow: 0 0 5px var(--borderPrimary);
        transition: left 0.1s;
        left: 100%;
        backdrop-filter: blur(20px) saturate(140%);
    }
}
   
#nav ul a li {
  border-radius: 14px;
  color: var(--text-1);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

#nav ul a li:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-0);
}

#nav ul a li.active {
  background: rgba(10, 132, 255, 0.18);
  color: var(--text-0);
  border: 1px solid rgba(10, 132, 255, 0.28);
}

/* Breadcrumbs */
.breadcrumbs {
  height: 44px !important;
  background: transparent !important;
  border-bottom: 2px solid var(--crumb-stroke) !important;
  top: 4em;
}

.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text-0) !important;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.breadcrumbs a:hover {
  background: var(--crumb-hover);
  border-color: rgba(255, 255, 255, 0.10);
}

.breadcrumbs a:active {
  transform: translateY(1px);
}

.breadcrumbs i.material-icons {
  font-size: 20px;
  opacity: 0.92;
}

/* Cards */
.card {
  background: var(--glass-2) !important;
  border: 1px solid var(--stroke-1) !important;
  border-radius: var(--radius-2) !important;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

/* Inputs and buttons (global) */
.input,
input,
textarea,
select {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--stroke-1) !important;
  border-radius: 14px !important;
  color: var(--text-0) !important;
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(10, 132, 255, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.18) !important;
  outline: none !important;
}

.button,
button.action {
  border-radius: 14px !important;
  border: 1px solid var(--stroke-1) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-0) !important;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.button:hover,
button.action:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: var(--stroke-2) !important;
}

.button:active,
button.action:active {
  transform: translateY(1px);
}

/* Context menu (right click menu).
   Filebrowser versions vary, so we target a few common containers. */
.context-menu,
.dropdown-menu,
.menu,
[role="menu"] {
  background: rgba(20, 24, 34, 0.3) !important;
}

.context-menu .action {
    margin: 0.1em;
}

#listing .item[aria-selected="true"] {
    background: #2196f345 !important;
    color: var(--iconSecondary) !important;
}
#listing.mosaic .item {
    width: calc(20% - 1em);
    margin: 0.5em;
    padding: 0.5em;
    border-radius: 0.6em;
    box-shadow: rgba(0, 0, 0, 0.06) 0px 1px 3px, rgba(0, 0, 0, 0.12) 0px 1px 2px;
}
#listing .item {
    background: rgb(83 83 83 / 30%);
    border-color: var(--divider);
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    color: var(--textPrimary);
    transition: background 0.1s, opacity 0.1s;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.context-menu .item,
.dropdown-menu .item,
.menu li,
[role="menu"] [role="menuitem"] {
  color: var(--text-0) !important;
}

.context-menu .item:hover,
.dropdown-menu .item:hover,
.menu li:hover,
[role="menu"] [role="menuitem"]:hover {
  background: rgba(255,255,255,0.08) !important;
}

/* Mobile overlay */
.overlay {
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  background: rgba(0, 0, 0, 0.25) !important;
}

/* Blur fallback */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #login form,
  .dashboard > header,
  #nav,
  .breadcrumbs,
  .card,
  .context-menu,
  .dropdown-menu,
  .menu,
  [role="menu"] {
    background: rgba(20, 24, 34, 0.92) !important;
  }
}
