/* ============================================================================
   FLOORP // UMBRELLA CORPORATION — NEW TAB PAGE STYLES
   Farben werden durch config.js zur Laufzeit überschrieben.
   Hier nur Layout & Struktur.
   ============================================================================ */

:root {
  --uc-bg-0: #0b0507;
  --uc-bg-1: #14080b;
  --uc-bg-2: #1d0d12;
  --uc-bg-3: #2a1118;
  --uc-bg-hover: #36141d;
  --uc-border: #4b1a24;
  --uc-border-soft: #34131c;

  --uc-red: #c8102e;
  --uc-red-bright: #e6223c;
  --uc-red-dim: #8b0a1f;
  --uc-red-glow: rgba(200, 16, 46, 0.35);
  --uc-red-soft: rgba(200, 16, 46, 0.12);

  --uc-text-0: #ececf0;
  --uc-text-1: #b8b8c2;
  --uc-text-2: #6a6a78;
  --uc-text-3: #44444f;

  --uc-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --uc-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --uc-content-width: 640px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html, body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(200, 16, 46, 0.28) 0%, transparent 44%),
    linear-gradient(180deg, #120608 0%, #0b0507 100%);
  color: var(--uc-text-0);
  font-family: var(--uc-sans);
  font-size: 13px;
  user-select: none;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px 20px;
  position: relative;
}

/* Scanline-Overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    rgba(255, 255, 255, 0.012) 2px,
    rgba(255, 255, 255, 0.012) 3px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Radialer roter Glow oben */
body::after {
  content: '';
  position: fixed;
  top: -300px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 800px;
  background: radial-gradient(circle, rgba(200, 16, 46, 0.36) 0%, rgba(200, 16, 46, 0.18) 26%, transparent 64%);
  pointer-events: none;
  z-index: 0;
}

/* === LOGO === */
#uc-logo {
  width: 88px;
  height: 88px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
#uc-logo svg {
  width: 100%; height: 100%;
  filter: drop-shadow(0 0 12px var(--uc-red-glow));
}

/* === BRANDING === */
#uc-branding {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}
.uc-title {
  font-family: var(--uc-mono);
  font-size: 11px;
  letter-spacing: 8px;
  color: var(--uc-text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.uc-name {
  font-family: var(--uc-mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--uc-text-0);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.uc-subtitle {
  font-family: var(--uc-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--uc-red);
  text-transform: uppercase;
}

/* === SEARCH === */
#uc-search {
  width: 100%;
  max-width: var(--uc-content-width);
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(200, 16, 46, 0.18), rgba(20, 8, 11, 0.96));
  border: 1px solid rgba(230, 34, 60, 0.8);
  border-radius: 4px;
  font-family: var(--uc-mono);
  font-size: 13px;
  transition: all 0.2s;
}
.search-box:hover, .search-box:focus-within {
  border-color: var(--uc-red-bright);
  box-shadow: 0 0 0 1px var(--uc-red-bright), 0 0 28px rgba(200, 16, 46, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.search-box svg {
  width: 16px; height: 16px;
  color: var(--uc-text-0);
  flex-shrink: 0;
  filter: brightness(1.15) contrast(1.8) drop-shadow(0 0 2px rgba(0,0,0,0.9));
}
.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--uc-text-0);
  font-family: var(--uc-mono);
  font-size: 13px;
}
.search-box input::placeholder { color: var(--uc-text-3); }
.search-shortcut {
  font-size: 10px;
  color: var(--uc-text-3);
  padding: 2px 6px;
  border: 1px solid var(--uc-border);
  border-radius: 2px;
}

/* === TILES === */
#uc-tiles {
  width: 100%;
  max-width: var(--uc-content-width);
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}
.tiles-toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tiles-toolbar button {
  appearance: none;
  border: 1px solid rgba(230, 34, 60, 0.55);
  background: rgba(20, 8, 11, 0.92);
  color: var(--uc-text-0);
  font-family: var(--uc-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.tiles-toolbar button:hover {
  background: var(--uc-red-soft);
  border-color: var(--uc-red-bright);
  color: var(--uc-text-0);
  box-shadow: 0 0 0 1px rgba(230, 34, 60, 0.35), 0 0 18px rgba(200, 16, 46, 0.2);
}
.tiles-toolbar button.secondary {
  color: var(--uc-text-1);
}
.tiles-toolbar button.active {
  background: var(--uc-red-soft);
  border-color: var(--uc-red-bright);
  color: var(--uc-text-0);
}
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.tile {
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, rgba(200, 16, 46, 0.24), rgba(20, 8, 11, 0.95));
  border: 1px solid rgba(230, 34, 60, 0.75);
  border-radius: 4px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(12px);
}
.tile {
  position: relative;
}
.tile-edit-mode .tile {
  cursor: pointer;
}
.tile-edit-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(230, 34, 60, 0.75);
  background: rgba(7, 2, 3, 0.82);
  color: var(--uc-text-0);
  font-family: var(--uc-mono);
  font-size: 12px;
  line-height: 1;
  display: none;
  cursor: pointer;
}
.tile-edit-mode .tile-edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tile-edit-button:hover {
  background: var(--uc-red-soft);
  border-color: var(--uc-red-bright);
}
.tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--uc-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}
.tile::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(200, 16, 46, 0.22));
  pointer-events: none;
}
.tile:hover {
  background: linear-gradient(180deg, rgba(230, 34, 60, 0.34), rgba(29, 13, 18, 0.98));
  border-color: var(--uc-red-bright);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--uc-red-bright), 0 8px 24px rgba(0,0,0,0.34), 0 0 24px var(--uc-red-glow);
}
.tile:hover::before { transform: scaleX(1); }
.tile-icon {
  width: 30px; height: 30px;
  padding: 4px;
  color: var(--uc-text-0);
  background: rgba(7, 2, 3, 0.30);
  border: 1px solid rgba(230, 34, 60, 0.35);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 0 0 1px rgba(0,0,0,0.25);
}
.tile-icon svg {
  width: 100%;
  height: 100%;
  filter: brightness(1.2) contrast(1.8) drop-shadow(0 0 1px rgba(0,0,0,0.9));
}
.tile-label {
  font-family: var(--uc-mono);
  font-size: 11px;
  color: var(--uc-text-1);
  letter-spacing: 0.5px;
}
.tile-meta {
  font-family: var(--uc-mono);
  font-size: 9px;
  color: var(--uc-text-3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.tile-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--uc-mono);
  font-size: 8px;
  color: var(--uc-red-bright);
  letter-spacing: 1px;
  padding: 2px 6px;
  background: var(--uc-red-soft);
  border-radius: 2px;
  text-transform: uppercase;
}

.tile-edit-mode .tile {
  cursor: pointer;
}

.tile-edit-button {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--uc-red-bright);
  border-radius: 4px;
  background: rgba(20, 8, 11, 0.92);
  color: var(--uc-text-0);
  font-family: var(--uc-mono);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(200, 16, 46, 0.18) inset;
}

.tile-edit-button:hover {
  background: var(--uc-red-dim);
  border-color: var(--uc-red);
}

.tile-edit-mode .tile-icon,
.tile-edit-mode .tile-label,
.tile-edit-mode .tile-meta {
  pointer-events: none;
}

/* === CONFIG BUNDLE DIALOG === */
.bundle-dialog {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--uc-text-0);
}
.bundle-dialog::backdrop {
  background: rgba(4, 1, 2, 0.72);
  backdrop-filter: blur(6px);
}
.bundle-card {
  width: min(860px, calc(100vw - 32px));
  background:
    linear-gradient(180deg, rgba(200, 16, 46, 0.20), rgba(18, 6, 8, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(230, 34, 60, 0.10), transparent 58%);
  border: 1px solid rgba(230, 34, 60, 0.62);
  border-radius: 10px;
  padding: 18px;
  box-shadow:
    0 0 0 1px rgba(200, 16, 46, 0.16) inset,
    0 24px 60px rgba(0, 0, 0, 0.55);
}
.bundle-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.bundle-kicker {
  font-family: var(--uc-mono);
  font-size: 10px;
  color: var(--uc-text-2);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.bundle-title {
  font-family: var(--uc-mono);
  font-size: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}
.bundle-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--uc-text-1);
}
.bundle-close {
  appearance: none;
  border: 1px solid var(--uc-border);
  background: rgba(20, 8, 11, 0.92);
  color: var(--uc-text-0);
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.bundle-close:hover {
  background: var(--uc-red-soft);
  border-color: var(--uc-red-bright);
}
.bundle-card textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border-radius: 6px;
  border: 1px solid var(--uc-border);
  background: rgba(4, 1, 2, 0.78);
  color: var(--uc-text-0);
  padding: 14px;
  font-family: var(--uc-mono);
  font-size: 12px;
  line-height: 1.5;
  outline: none;
}
.bundle-card textarea:focus {
  border-color: var(--uc-red-bright);
  box-shadow: 0 0 0 1px var(--uc-red-bright);
}
.bundle-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.bundle-actions button {
  appearance: none;
  border: 1px solid rgba(230, 34, 60, 0.55);
  background: rgba(20, 8, 11, 0.92);
  color: var(--uc-text-0);
  font-family: var(--uc-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}
.bundle-actions button:hover {
  background: var(--uc-red-soft);
  border-color: var(--uc-red-bright);
}
.bundle-actions .primary {
  background: var(--uc-red-soft);
  border-color: var(--uc-red-bright);
}

/* === SYSTEM PANEL === */
#uc-syspanel {
  width: 100%;
  max-width: var(--uc-content-width);
  position: relative;
  z-index: 1;
  margin-bottom: 28px;
}
.syspanel {
  background:
    linear-gradient(180deg, rgba(200, 16, 46, 0.18), rgba(20, 8, 11, 0.95)),
    radial-gradient(circle at 50% 0%, rgba(230, 34, 60, 0.10), transparent 52%);
  border: 1px solid rgba(230, 34, 60, 0.58);
  border-radius: 8px;
  padding: 18px 20px 20px;
  font-family: var(--uc-mono);
  font-size: 11px;
  box-shadow:
    0 0 0 1px rgba(200, 16, 46, 0.14) inset,
    0 12px 30px rgba(0, 0, 0, 0.22);
}
.syspanel:first-child {
  border-color: var(--uc-red-dim);
  box-shadow: 0 0 0 1px rgba(200, 16, 46, 0.22) inset;
}
.syspanel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--uc-border-soft);
  margin-bottom: 12px;
}
.syspanel-title {
  color: var(--uc-text-2);
  letter-spacing: 2.4px;
  text-transform: uppercase;
  font-size: 10px;
}
.syspanel-led {
  display: flex; align-items: center; gap: 6px;
  color: var(--uc-red-bright);
  font-size: 10px;
  letter-spacing: 1.4px;
}
.led-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--uc-red);
  box-shadow: 0 0 6px var(--uc-red);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.syspanel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 9px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.014);
  border: 1px solid rgba(200, 16, 46, 0.12);
}
.stat-label {
  color: var(--uc-text-3);
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.stat-value {
  color: var(--uc-text-0);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  word-break: break-word;
}
.stat-value.ok { color: var(--uc-red-bright); }

/* === FOOTER === */
#uc-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  width: 100%;
  max-width: var(--uc-content-width);
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
  font-family: var(--uc-mono);
  font-size: 10px;
  color: var(--uc-text-2);
  letter-spacing: 1.2px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  border-top: 1px solid var(--uc-red-dim);
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.24), rgba(200, 16, 46, 0.10) 30%, rgba(20, 8, 11, 0.96) 100%);
}
#uc-footer .status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--uc-text-0);
  position: relative;
  padding-inline-start: 11px;
}
#uc-footer .status-spacer {
  flex: 1;
}
#uc-footer .status-item.right {
  color: var(--uc-text-2);
}
#uc-footer .status-item.alert {
  color: var(--uc-red-bright);
}
#uc-footer .status-item::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 1px;
  background: var(--uc-red);
  box-shadow: 0 0 10px var(--uc-red-glow);
  flex-shrink: 0;
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
}
#uc-footer .led-dot {
  width: 6px;
  height: 6px;
}
#uc-footer a {
  color: var(--uc-red-bright);
  text-decoration: none;
}
#uc-footer a:hover {
  color: var(--uc-text-0);
  text-decoration: underline;
}

body.ready .reveal-item {
  animation: revealUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}

body.ready .tile {
  animation: tileRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--tile-delay, 0ms) + 120ms);
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tileRise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* === RESPONSIVE === */
@media (max-width: 720px) {
  .tiles-grid { grid-template-columns: repeat(2, 1fr); }
  .syspanel-grid { grid-template-columns: repeat(2, 1fr); }
  #uc-footer {
    white-space: normal;
    gap: 10px 14px;
    flex-wrap: wrap;
    padding-top: 16px;
  }
}

@media (max-width: 480px) {
  body { padding: 32px 16px; }
  .uc-name { font-size: 22px; letter-spacing: 2px; }
  .tiles-grid { grid-template-columns: 1fr; }
  .syspanel-grid { grid-template-columns: 1fr; }
  #uc-footer {
    font-size: 9px;
    letter-spacing: 1px;
  }
}
