/* ===========================================
   Werkblick CI für Filebrowser
   Charcoal #131415 · Orange #FF6600 · Inter
   Single dark theme — keine Switcher.
   ============================================ */

/* Inter via Google Fonts (variable) */
@import url('https://rsms.me/inter/inter.css');

/* ─── Werkblick-CI-Tokens ──────────────────────────────────────
   Filebrowsers Defaults werden komplett überschrieben.
   Greift auch wenn user im Settings auf "light" klickt — Vars
   sind via :root + body-Selectors gegen alle Theme-Klassen verriegelt.
   ──────────────────────────────────────────────────────────── */
:root,
body,
body.rtl,
body[data-theme="light"],
body.light {
  /* Charcoal-Layer */
  --background: #131415 !important;
  --surfacePrimary: #1E1F20 !important;
  --surfaceSecondary: #2A2B2C !important;
  --divider: #3D3E40 !important;

  /* Text */
  --textPrimary: #F7F7F8 !important;
  --textSecondary: #B5B7BA !important;
  --icon: #F7F7F8 !important;

  /* App-Aktionen — alle Buttons/Links jetzt Werkblick-Orange */
  --blue: #FF6600 !important;
  --dark-blue: #CC5100 !important;
  --moon-grey: #3D3E40 !important;
  --item-selected: #FF6600 !important;

  /* File-Type-Icons — neutral & Werkblick-tauglich */
  --icon-blue: #63A4E0 !important;
  --icon-green: #34D399 !important;
  --icon-orange: #FF8432 !important;
  --icon-red: #F87171 !important;
  --icon-violet: #B58CD7 !important;
  --icon-yellow: #FBBF24 !important;
}

/* Inter überall */
html, body, body * {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Material-Icons-Font wieder aktivieren (sonst kaputt) */
.material-icons,
.material-icons * {
  font-family: 'Material Icons' !important;
}

/* ─── Theme-Switcher in Settings ausblenden ──────────────────── */
.settings-tab[data-tab="theme"],
[id*="theme-options"],
input[type="radio"][value="light"],
input[type="radio"][value="dark"],
label[for*="light-theme"],
label[for*="dark-theme"],
.theme-options,
[class*="ThemeSelect"],
fieldset[name="theme"],
fieldset[id*="theme"] {
  display: none !important;
}

/* ─── Sidebar / Navigation ───────────────────────────────────── */
nav .action {
  border-radius: 8px !important;
  margin: 2px 8px !important;
}
nav .action:hover {
  background: rgba(255, 102, 0, 0.10) !important;
}
nav .action.selected,
nav .action[data-active="true"] {
  background: rgba(255, 102, 0, 0.18) !important;
  color: #FF6600 !important;
}
nav .action.selected i,
nav .action[data-active="true"] i {
  color: #FF6600 !important;
}

/* ─── Header / TopBar ────────────────────────────────────────── */
header {
  background: #131415 !important;
  border-bottom: 1px solid #3D3E40 !important;
  box-shadow: none !important;
}

header img.logo,
header img[src*="logo"] {
  height: 30px !important;
  width: auto !important;
  filter: drop-shadow(0 0 12px rgba(255, 102, 0, 0.20));
}

/* ─── Search ─────────────────────────────────────────────────── */
#search #input {
  background: #1E1F20 !important;
  border: 1px solid #3D3E40 !important;
  border-radius: 8px !important;
}
#search #input:focus-within,
#search.active #input {
  border-color: #FF6600 !important;
  background: #2A2B2C !important;
}

/* ─── File-Listing ───────────────────────────────────────────── */
#listing .item {
  border-radius: 6px !important;
  border: 1px solid transparent !important;
  transition: all 0.15s ease !important;
}
#listing .item:hover {
  background: rgba(255, 102, 0, 0.06) !important;
  border-color: rgba(255, 102, 0, 0.20) !important;
}
#listing .item[aria-selected="true"] {
  background: rgba(255, 102, 0, 0.14) !important;
  border-color: #FF6600 !important;
}
#listing .item[aria-selected="true"] i,
#listing .item[aria-selected="true"] p {
  color: #F7F7F8 !important;
}

/* Header-Row der Listings */
#listing .header,
#listing > div:first-child {
  color: #8B8D90 !important;
  border-bottom: 1px solid #3D3E40 !important;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.button,
.button--flat {
  border-radius: 6px !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
}
.button:not(.button--flat) {
  background: #FF6600 !important;
  color: #131415 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}
.button:not(.button--flat):hover {
  background: #FF8432 !important;
  transform: translateY(-1px);
}
.button--flat {
  color: #FF6600 !important;
}
.button--flat:hover {
  background: rgba(255, 102, 0, 0.10) !important;
}

/* ─── Login-Page ────────────────────────────────────────────── */
#login {
  background: #131415 !important;
}
#login form {
  background: #1E1F20 !important;
  border: 1px solid #3D3E40 !important;
  border-radius: 12px !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5) !important;
}
#login input {
  background: #2A2B2C !important;
  border: 1px solid #3D3E40 !important;
  color: #F7F7F8 !important;
  border-radius: 6px !important;
}
#login input:focus {
  border-color: #FF6600 !important;
  outline: none !important;
}
#login button[type="submit"] {
  background: #FF6600 !important;
  color: #131415 !important;
  font-weight: 700 !important;
}

/* ─── Breadcrumbs ────────────────────────────────────────────── */
.breadcrumbs {
  border-bottom: 1px solid #3D3E40 !important;
}
.breadcrumbs a:hover,
.breadcrumbs span:hover {
  background: rgba(255, 102, 0, 0.10) !important;
  color: #FF6600 !important;
}

/* ─── Dialog / Modal / Card ──────────────────────────────────── */
.card,
.prompt {
  background: #1E1F20 !important;
  border: 1px solid #3D3E40 !important;
  border-radius: 8px !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5) !important;
  color: #F7F7F8 !important;
}
.card-action button {
  color: #FF6600 !important;
}

/* ─── Spinner ────────────────────────────────────────────────── */
.spinner > div,
main .spinner > div {
  background: #FF6600 !important;
}

/* ─── Footer "Hilfe / File Browser 2.27.0" ───────────────────── */
nav > div:last-child {
  color: #8B8D90 !important;
  font-size: 11px !important;
  letter-spacing: 0.04em !important;
}
nav > div:last-child a {
  color: #FF6600 !important;
}

/* ─── Disk-Usage-Bar ─────────────────────────────────────────── */
.credits .progress {
  background: #2A2B2C !important;
}
.credits .progress > div {
  background: #FF6600 !important;
}

/* ===========================================
   Custom-UI: Per-File-Buttons (in-tab + share)
   ============================================ */
.wb-newtab-btn,
.wb-share-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 6px !important;
  border-radius: 6px;
  text-decoration: none !important;
  transition: background 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
  cursor: pointer;
}
.wb-newtab-btn {
  background: #FF6600 !important;
  color: #131415 !important;
}
.wb-newtab-btn:hover {
  background: #FF8432 !important;
  transform: translateY(-1px);
}
.wb-share-btn {
  background: rgba(255, 102, 0, 0.12) !important;
  color: #FF6600 !important;
  border: 1px solid rgba(255, 102, 0, 0.32);
}
.wb-share-btn:hover {
  background: rgba(255, 102, 0, 0.22) !important;
  border-color: #FF6600;
  transform: translateY(-1px);
}
.wb-newtab-btn:active,
.wb-share-btn:active {
  transform: translateY(0);
}
.wb-newtab-btn svg,
.wb-share-btn svg {
  display: block;
}

/* ===========================================
   Share-Modal
   ============================================ */
.wb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(19, 20, 21, 0.78);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: wb-fade-in 0.18s ease-out;
}
@keyframes wb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.wb-modal {
  background: linear-gradient(180deg, #1E1F20 0%, #17181A 100%);
  border: 1px solid #3D3E40;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 102, 0, 0.08);
  position: relative;
  overflow: hidden;
  animation: wb-pop-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes wb-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.wb-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 3px; width: 64px;
  background: #FF6600;
}

.wb-modal-header {
  padding: 32px 36px 16px;
  border-bottom: 1px solid #3D3E40;
}
.wb-modal-eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #FF6600;
  font-weight: 700;
  margin-bottom: 10px;
}
.wb-modal-header h3 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: #F7F7F8;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.wb-modal-file {
  margin: 0;
  font-size: 13px;
  color: #8B8D90;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
}

.wb-modal-body {
  padding: 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.wb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wb-field > span {
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #B5B7BA;
  font-weight: 600;
}
.wb-field > span em {
  color: #8B8D90;
  font-weight: 400;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}
.wb-field input,
.wb-field select {
  background: #131415 !important;
  border: 1px solid #3D3E40 !important;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: #F7F7F8 !important;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.wb-field input:focus,
.wb-field select:focus {
  border-color: #FF6600 !important;
}
.wb-field input::placeholder {
  color: #55575A;
}

.wb-modal-actions {
  padding: 18px 36px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #3D3E40;
}

.wb-btn {
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.15s ease;
}
.wb-btn:disabled { opacity: 0.6; cursor: wait; }
.wb-btn-primary {
  background: #FF6600;
  color: #131415;
}
.wb-btn-primary:hover:not(:disabled) {
  background: #FF8432;
  transform: translateY(-1px);
}
.wb-btn-secondary {
  background: transparent;
  color: #B5B7BA;
  border: 1px solid #3D3E40;
}
.wb-btn-secondary:hover {
  background: #2A2B2C;
  color: #F7F7F8;
}

.wb-modal-result {
  padding: 0 36px 28px;
}
.wb-share-success {
  background: rgba(255, 102, 0, 0.06);
  border: 1px solid rgba(255, 102, 0, 0.32);
  border-left: 3px solid #FF6600;
  border-radius: 6px;
  padding: 18px 20px;
}
.wb-share-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #FF6600;
  font-weight: 700;
  margin-bottom: 8px;
}
.wb-share-meta {
  font-size: 13px;
  color: #B5B7BA;
  margin-bottom: 14px;
}
.wb-share-meta strong {
  color: #F7F7F8;
  font-weight: 600;
}
.wb-share-url-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
#wb-url {
  flex: 1;
  background: #131415 !important;
  border: 1px solid #3D3E40 !important;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #F7F7F8 !important;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  outline: none;
}
#wb-url:focus,
#wb-edit-url:focus {
  border-color: #FF6600 !important;
}

/* ===========================================
   Wide modal (Shares-List)
   ============================================ */
.wb-modal-wide {
  max-width: 920px;
}

.wb-modal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #8B8D90;
  letter-spacing: 0.04em;
}

.wb-modal-warning {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 6px;
  font-size: 13px;
  color: #FBBF24;
  line-height: 1.45;
}
.wb-modal-warning strong {
  color: #F7F7F8;
  font-weight: 700;
}

.wb-shares-list {
  max-height: 60vh;
  overflow-y: auto;
  padding: 16px 24px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wb-shares-list::-webkit-scrollbar {
  width: 8px;
}
.wb-shares-list::-webkit-scrollbar-thumb {
  background: #3D3E40;
  border-radius: 4px;
}
.wb-shares-list::-webkit-scrollbar-thumb:hover {
  background: #55575A;
}

.wb-empty {
  padding: 32px;
  text-align: center;
  font-size: 14px;
  color: #8B8D90;
  font-style: italic;
}

.wb-loading-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.wb-spinner-small {
  width: 28px; height: 28px;
  border: 3px solid #3D3E40;
  border-top-color: #FF6600;
  border-radius: 50%;
  animation: wb-spin 0.8s linear infinite;
}
@keyframes wb-spin {
  to { transform: rotate(360deg); }
}

/* Share-Row */
.wb-share-row {
  background: #131415;
  border: 1px solid #3D3E40;
  border-radius: 8px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wb-share-row:hover {
  border-color: rgba(255, 102, 0, 0.32);
  background: #17181A;
}
.wb-share-row.wb-expired {
  opacity: 0.7;
  border-color: rgba(248, 113, 113, 0.32);
}
.wb-share-row.wb-expired:hover {
  border-color: #F87171;
}

.wb-share-info {
  min-width: 0;
}
.wb-share-name {
  font-size: 16px;
  font-weight: 700;
  color: #F7F7F8;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  word-break: break-word;
}
.wb-share-path {
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #8B8D90;
  font-weight: 600;
  margin-bottom: 10px;
}

.wb-share-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.wb-share-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: #2A2B2C;
  border: 1px solid #3D3E40;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #B5B7BA;
  letter-spacing: 0.02em;
}
.wb-share-badge svg {
  width: 12px; height: 12px;
  flex-shrink: 0;
}
.wb-share-badge.wb-badge-pw {
  background: rgba(255, 102, 0, 0.10);
  border-color: rgba(255, 102, 0, 0.32);
  color: #FF6600;
}
.wb-share-badge.wb-badge-danger {
  background: rgba(248, 113, 113, 0.10);
  border-color: rgba(248, 113, 113, 0.32);
  color: #F87171;
}

.wb-share-url-display {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #B5B7BA;
  word-break: break-all;
  background: #1E1F20;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #2A2B2C;
}

.wb-share-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: stretch;
  flex-shrink: 0;
}
.wb-share-actions .wb-btn {
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
  min-width: 110px;
  white-space: nowrap;
}

.wb-btn.wb-btn-flat {
  background: #2A2B2C;
  color: #F7F7F8;
  border: 1px solid #3D3E40;
}
.wb-btn.wb-btn-flat:hover:not(:disabled) {
  background: #3D3E40;
  border-color: #55575A;
}
.wb-btn.wb-btn-flat.wb-btn-danger {
  color: #F87171;
}
.wb-btn.wb-btn-flat.wb-btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.40);
}

/* Sidebar Nav-Item */
.wb-nav-shares i.material-icons {
  color: #FF6600 !important;
}
.wb-nav-shares:hover i.material-icons {
  color: #FF8432 !important;
}

@media (max-width: 700px) {
  .wb-share-row {
    grid-template-columns: 1fr;
  }
  .wb-share-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
