/* © MK_Kasi · Vaultly · Einstellungen-Panel */

/* ============================================================
   OVERLAY
   ============================================================ */

.einstell-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 60px 16px 16px;
}

.einstell-overlay.versteckt { display: none; }

/* ============================================================
   PANEL
   ============================================================ */

.einstell-panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 100%;
  max-width: 380px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  transform-origin: top right;
  animation: panelEinblenden 0.28s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
  overflow: hidden;
}

@keyframes panelEinblenden {
  from { opacity: 0; transform: scale(0.88) translateY(-12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   HEADER
   ============================================================ */

.einstell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.einstell-titel {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.einstell-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-appearance: none;
}
.einstell-close:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}

/* ============================================================
   3×3 KACHEL-GRID
   ============================================================ */

.einstell-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

/* ============================================================
   EINZELNE KACHEL
   ============================================================ */

.einstell-kachel {
  background: var(--surface);
  border: none;
  padding: 22px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-height: 88px;

  /* Animations-Vorbereitung: startet unsichtbar */
  opacity: 0;
  transform: scale(0.7) translateY(10px);
}

.einstell-kachel:hover { background: var(--surface-2); }
.einstell-kachel:active { background: var(--border); }

.einstell-kachel.sichtbar {
  animation: kachelEinblenden 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

@keyframes kachelEinblenden {
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.einstell-icon {
  font-size: 26px;
  line-height: 1;
  display: block;
}

.einstell-label {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.3;
}

/* Deaktivierte Kacheln (Platzhalter) */
.einstell-kachel[data-aktion="backup"],
.einstell-kachel[data-aktion="export"],
.einstell-kachel[data-aktion="hilfe"] {
  opacity: 0.35 !important;
  cursor: not-allowed;
}
.einstell-kachel[data-aktion="backup"]:hover,
.einstell-kachel[data-aktion="export"]:hover,
.einstell-kachel[data-aktion="hilfe"]:hover {
  background: var(--surface);
}

/* Benutzer-Kachel aktiv */
.einstell-kachel-benutzer { opacity: 1 !important; cursor: pointer; }
.einstell-kachel-benutzer:hover { background: rgba(74,158,255,0.07) !important; }
.einstell-kachel-benutzer .einstell-label { color: rgba(74,158,255,0.75); }

/* Abmelden — aktiv, rötlicher Hover */
.einstell-kachel-abmelden { opacity: 1 !important; cursor: pointer; }
.einstell-kachel-abmelden:hover {
  background: rgba(255, 64, 64, 0.07) !important;
}
.einstell-kachel-abmelden .einstell-label {
  color: rgba(255, 100, 100, 0.75);
}

/* ============================================================
   ANIMATION: SETTINGS-BUTTON DOT-GRID WACKELN
   ============================================================ */

@keyframes dotWiggle {
  0%, 100% { transform: rotate(0deg); }
  25%       { transform: rotate(15deg); }
  75%       { transform: rotate(-10deg); }
}

/* ============================================================
   SUB-MODAL: PIN ÄNDERN (eingebettet im Panel)
   ============================================================ */

.pin-change-bereich {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: none;
}
.pin-change-bereich.sichtbar { display: block; }

.pin-change-zeile {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Über-Vaultly Info-Bereich */
.info-bereich {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: none;
}
.info-bereich.sichtbar { display: block; }
.info-zeile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-zeile:last-child { border-bottom: none; }
.info-zeile span:first-child { color: var(--text-muted); font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
  .einstell-overlay {
    padding: 56px 0 0;
    align-items: flex-start;
    justify-content: stretch;
  }
  .einstell-panel {
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
    max-height: 85vh;
    overflow-y: auto;
  }
  .einstell-kachel {
    min-height: 80px;
    padding: 18px 8px 14px;
  }
  .einstell-icon { font-size: 22px; }
}
