/* ==========================================================================
   PROTONES Start Center
   Clean stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #070b12;
  --bg-soft: #0d131d;

  --panel: #111824d9;
  --panel-strong: #121a27ee;
  --panel2: #1a2230e8;

  --line: #2a3547;
  --line-soft: #ffffff18;
  --line-focus: #6b7890;

  --text: #f5f7fb;
  --muted: #aab4c3;

  --accent: #4c14cf;
  --accent-hover: #621de1;
  --accent2: #f4f7fb;

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow: 0 24px 80px #0008;
  --shadow-soft: 0 18px 48px #0006;

  --blur: blur(16px);
  --transition: 0.18s ease;

  --page-width: min(1880px, calc(100% - 64px));
  --admin-width: min(1880px, calc(100% - 64px));
}

/* --------------------------------------------------------------------------
   Reset / Base
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: #070b12 url("/static/img/pt_background.jpg") center center / cover no-repeat fixed;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

body::before {
  display: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  color: var(--text);
  border: 1px solid #ffffff22;
  border-radius: 15px;
  outline: none;
  background: #20262fee;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-focus);
  box-shadow: 0 0 0 3px #ffffff12;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

form button,
.web-search button {
  padding: 14px 22px;
  color: #fff;
  font-weight: 900;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
}

form button:hover,
.web-search button:hover {
  background: var(--accent-hover);
}

.hidden {
  display: none !important;
}

.hint {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Background Layer
   -------------------------------------------------------------------------- */
.background-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: rgba(5, 8, 14, 0.62);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Shared Layout / Cards
   -------------------------------------------------------------------------- */
.shell,
.topbar {
  width: var(--page-width);
}

.shell {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 42px auto 92px;
}

.panel,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
}

.card {
  padding: 24px;
}

section.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 28px auto 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 56px;
  max-height: 56px;
  object-fit: contain;
}

.brand-title {
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.search-wrap input {
  width: min(390px, 32vw);
  padding: 14px 18px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: #1b222df0;
}

/* --------------------------------------------------------------------------
   Desktop Search + Clock
   -------------------------------------------------------------------------- */
.desktop-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  margin-bottom: 10px;
}

.desktop-search-card {
  padding: 32px;
}

.desktop-brand-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 26px;
}

.desktop-brand-row img {
  width: 96px;
  max-height: 96px;
  padding: 10px;
  object-fit: contain;
  border-radius: 22px;
  background: #11151ddd;
  box-shadow: inset 0 0 0 1px #ffffff0c;
}

.desktop-brand-row h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.desktop-brand-row p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.web-search {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 14px;
}

.web-search input {
  padding: 18px 22px;
  color: var(--text);
  border: 1px solid #ffffff1f;
  border-radius: var(--radius-md);
  background: #20252eee;
  font-size: 16px;
}

.clock-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 28px;
}

.clock-time {
  font-size: 72px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.clock-date {
  margin-top: 20px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.category-nav,
.subcategory-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-btn {
  padding: 10px 16px;
  color: var(--text);
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #1b222ddd;
}

.nav-btn:hover {
  border-color: #ffffff33;
  background: #232c3add;
}

.nav-btn.active {
  color: #10151f;
  background: var(--accent2);
}

/* --------------------------------------------------------------------------
   Startseite: Kategorie-Container
   -------------------------------------------------------------------------- */
.section-grid,
.sections-grid,
.link-sections,
.category-sections,
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.section-grid > .panel:only-child,
.sections-grid > .panel:only-child,
.link-sections > .panel:only-child,
.category-sections > .panel:only-child,
.content-grid > .panel:only-child {
  grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   Tiles
   small  = 1/8
   medium = 2/8
   large  = 4/8
   wide   = 8/8
   dense  = füllt Lücken automatisch mit passenden späteren Kacheln
   -------------------------------------------------------------------------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
  align-items: stretch;
}

.tile {
  display: flex;
  width: auto;
  height: 130px;
  min-width: 0;
  padding: 18px;
  gap: 14px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: linear-gradient(145deg, #222a36e8, #171e29e8);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.tile:hover {
  transform: translateY(-2px);
  border-color: #ffffff40;
  background: #242d3bee;
}

.tile .icon {
  font-size: 28px;
  line-height: 1;
}

.tile h3 {
  margin: 8px 0 4px;
  font-size: 16px;
}

.tile p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tile.icon_top {
  flex-direction: column;
}

.tile.icon_left {
  align-items: center;
}

.tile.small {
  grid-column: span 1;
}

.tile.medium {
  grid-column: span 2;
}

.tile.large {
  grid-column: span 4;
}

.tile.wide {
  grid-column: 1 / -1;
}

/* Pins: immer Small + Text rechts vom Icon */
#pinnedGrid.tile-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-flow: dense;
}

#pinnedGrid .tile,
#pinnedGrid .tile.small,
#pinnedGrid .tile.medium,
#pinnedGrid .tile.large,
#pinnedGrid .tile.wide {
  grid-column: span 1 !important;
  height: 130px;
  flex-direction: row !important;
  align-items: center !important;
}

#pinnedGrid .tile .icon {
  flex: 0 0 auto;
}

#pinnedGrid .tile h3 {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   Floating Admin / Version
   -------------------------------------------------------------------------- */
.admin-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #32425b;
  border-radius: 50%;
  background: #142034;
  box-shadow: var(--shadow);
}

.admin-float:hover {
  border-color: #ffffff55;
  background: #1a2b46;
}

.version-badge {
  position: fixed;
  left: 10px;
  bottom: 8px;
  color: #ffffff26;
  font-size: 10px;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Admin Layout
   -------------------------------------------------------------------------- */
.admin-shell {
  width: var(--admin-width);
  margin: 32px auto 80px;
}

.admin-login {
  max-width: 460px;
  margin: 12vh auto;
  padding: 32px;
}

.admin-login form {
  display: grid;
  gap: 12px;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.admin-head h1 {
  margin: 0;
}

.admin-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.link-card {
  grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   Admin Forms
   -------------------------------------------------------------------------- */
.stack-form {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.check input {
  width: auto;
}

.ghost-btn,
.mini {
  padding: 10px 14px;
  color: #101520;
  font-weight: 900;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef1f7;
}

.ghost-btn:hover,
.mini:hover {
  background: #fff;
}

.mini.danger {
  color: #fff;
  border-color: #5b408d;
  background: #4c275b;
}

.mini.danger:hover {
  background: #6a3178;
}

.icon-input-wrap {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
}

.icon-picker-trigger {
  color: #101520;
  font-weight: 900;
  border: 0;
  border-radius: 14px;
  background: #eef1f7;
}

.icon-picker-trigger:hover {
  background: #fff;
}

/* --------------------------------------------------------------------------
   Admin Lists
   -------------------------------------------------------------------------- */
.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-list.compact {
  max-height: 420px;
  overflow: auto;
  padding-right: 8px;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: #171e29dd;
}

.admin-item small {
  color: var(--muted);
}

.admin-item-actions {
  display: flex;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Icon Picker
   -------------------------------------------------------------------------- */
.icon-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.icon-picker-backdrop {
  position: absolute;
  inset: 0;
  background: #000b;
}

.icon-picker-card {
  position: relative;
  width: min(920px, calc(100% - 40px));
  max-height: min(760px, calc(100vh - 50px));
  overflow: auto;
  padding: 24px;
  border: 1px solid #35445c;
  border-radius: var(--radius-lg);
  background: #101722f8;
  box-shadow: var(--shadow);
}

.icon-picker-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.icon-picker-head h2 {
  margin: 0;
}

.icon-picker-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 10px;
}

.icon-choice {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 12px 8px;
  color: var(--text);
  border: 1px solid #ffffff20;
  border-radius: 14px;
  background: #1b2430;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.icon-choice:hover {
  transform: translateY(-1px);
  border-color: #ffffff55;
  background: #263244;
}

.icon-choice span {
  font-size: 25px;
}

.icon-choice small {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .tile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tile.small {
    grid-column: span 1;
  }

  .tile.medium {
    grid-column: span 2;
  }

  .tile.large,
  .tile.wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .desktop-tools {
    display: none !important;
  }

  .section-grid,
  .sections-grid,
  .link-sections,
  .category-sections,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --page-width: min(100% - 28px, 100%);
    --admin-width: min(100% - 28px, 100%);
  }

  .topbar {
    margin: 18px auto;
  }

  .compact-filter input {
    width: 48vw;
  }

  .shell {
    margin: 24px auto 80px;
  }

  .tile-grid,
  .admin-grid,
  .form-row,
  .form-row.three {
    grid-template-columns: 1fr;
  }

  .tile,
  .tile.small,
  .tile.medium,
  .tile.large,
  .tile.wide {
    grid-column: 1 / -1;
    width: auto;
  }

  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .icon-picker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .version-badge {
    display: none;
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-wrap {
    width: 100%;
  }

  .search-wrap input {
    width: 100%;
  }

  .icon-input-wrap {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    flex-wrap: wrap;
  }
}