/* =========================
   DEMOS (SimpleDoc, Kindertreff, Foto-Sharing)
   Voraussetzung: /assets/css/tokens.css
========================= */

/* =========================
   BASE / RESET
========================= */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
}

.status {
  margin-top: 0.6rem;
  min-height: 1.2em;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status[data-type="ok"] { color: #0f766e; }
.status[data-type="error"] { color: #b91c1c; }


/* Demo-Hintergrund (wie Hauptseite, leicht anderes Overlay) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.35), rgba(255,255,255,0.35)),
    url("/assets/img/infinity4.png");
  background-size: cover;
  background-position: center;
  z-index: -1;
}

.demo-topbar {
  max-width: 900px;
  margin: 0 auto 1rem;
  padding: 0 0.25rem;
  text-align: center;
}

.demo-back {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  border: 1px solid #e5e7eb;
  color: var(--blue-main);
  font-weight: 600;
  text-decoration: none;
}

.demo-back:hover {
  background: rgba(255,255,255,0.9);
}


/* Links */
a {
  color: var(--blue-accent);
  text-decoration: none;
  font-weight: 600;
}
a:hover { text-decoration: underline; }

/* =========================
   TYPO
========================= */

h1 {
  margin: 0 0 1rem;
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--blue-main);
}

h2 {
  margin: 1.2rem 0 0.6rem;
  font-size: 1.15rem;
  color: var(--blue-main);
}

h3 {
  margin: 1.2rem 0 0.6rem;
  font-size: 1.05rem;
  color: var(--text-main);
}

p { line-height: 1.7; }

/* Infotexte (Kindertreff oben/unten) */
.demo-info,
footer.demo-info {
  display: block;
  text-align: center;
  max-width: 600px;
  margin: 1rem auto;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.back-to-top {
  text-align: center;
  margin: var(--space-xl) 0 var(--space-l);
}

.back-to-top a {
  font-weight: 500;
  text-decoration: none;
}

.back-to-top a:hover,
.back-to-top a:focus {
  text-decoration: underline;
}

/* =========================
   LAYOUT / CONTAINERS
========================= */

.container,
main {
  max-width: 900px;
  margin: 0 auto;
}

/* Pages mit <main class="container"> (Foto-Sharing, SimpleDoc) */
.container {
  background: rgba(255,255,255,0.75);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 2.25rem;
}

/* Kindertreff nutzt <main> ohne .container */
main {
  background: rgba(255,255,255,0.65);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
}

/* Kindertreff Header */
header {
  text-align: center;
  padding: 1.25rem 1rem;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
}

/* =========================
   SECTIONS / CARDS
========================= */

section,
.card {
  background: rgba(255,255,255,0.85);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
}

section { margin-bottom: 1.25rem; }

/* Utilities */
.hidden { display: none; }

/* =========================
   FORMS (gemeinsame Basis)
========================= */

form {
  display: grid;
  gap: 1.1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-main);
  font-size: 0.95rem;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 1rem;
  flex: 1;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: rgba(255,255,255,0.9);
  color: var(--text-main);
}

textarea { resize: vertical; }

.checkbox-group label {
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
}

/* =========================
   BUTTONS
========================= */

button {
  cursor: pointer;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  background: #007bff;
  color: white;
}

button:hover {
  background: #0056b3;
  transform: translateY(-1px);
}
button:active { transform: translateY(0); }

/* Secondary (z. B. Kindertreff Bearbeiten/Löschen) */
button.secondary {
  background: rgba(255,255,255,0.75);
  color: var(--text-muted);
  border: 1px solid #e5e7eb;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}
button.secondary:hover {
  background: rgba(255,255,255,0.95);
}

/* Foto-Sharing: Luft zwischen Inputs/Buttons */
#authSection input,
#authSection button,
#uploadSection input,
#uploadSection button {
  margin-top: 0.75rem;
}
#authSection button + button {
  margin-top: 0.5rem;
}

/* =========================
   KINDERTREFF – Layout
========================= */

/* Start/Ende nebeneinander */
.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
@media (max-width: 520px) {
  .time-grid { grid-template-columns: 1fr; }
}

/* Woche */
#week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  #week { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  #week { grid-template-columns: 1fr; }
  .room-stage {
    height: 260px;
  }
  .panel {
    font-size: 14px;
  }
}

.day {
  background: rgba(255,255,255,0.85);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid #e5e7eb;
}

.day h3 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.entry {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.6rem;
  background: rgba(255,255,255,0.9);
}

.entry.own {
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.20);
}

/* =========================
   SIMPLEDOC – Notes
========================= */

.note-card {
  background: rgba(255,255,255,0.8);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
}

.note-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

/* =========================
   FOTO-SHARING – Galerie/Status
========================= */

#uploadStatus {
  min-height: 1.2em;
  font-size: 0.9rem;
  color: var(--text-muted);
}

#gallery img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.75rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

/* Foto-Sharing: Galerie-Layout */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.gallery-item {
  background: rgba(255,255,255,0.75);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.75rem;
}

.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.gallery-item a {
  width: 100%;
  margin-top: 0.75rem;
  text-align: center;
  display: inline-flex;
  justify-content: center;
}

.share-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.share-label {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-main);
  font-weight: 600;
}

.gallery-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.photo-select {
  width: 18px;
  height: 18px;
}

.photo-item {
  position: relative;
  overflow: hidden;
}

.photo-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s ease;
}

.photo-item:hover .photo-actions {
  opacity: 1;
}

.photo-action-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.photo-action-icon:hover {
  background: rgba(0,0,0,0.85);
}

.photo-item img{
  display:block;
  border-radius: 10px;
  border: 2px solid transparent !important; /* überschreibt vorhandene img borders */
  box-sizing: border-box;
  cursor: pointer;
}

.photo-item.is-selected {
  color: var(--accent, #111); /* nutzt Token, falls vorhanden */
}

.photo-item.is-selected img{
  border-color: currentColor !important;
}


.photo-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(0,0,0,0.65);
  color: #fff;
  pointer-events: none;
}




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

@media (max-width: 600px) {
  body { padding: 1.5rem 1rem; }
  .container, main { padding: 1.25rem; }
}

/* =========================
   FOOTER (Legal-Links in Demos)
========================= */

.site-footer {
  max-width: 900px;
  margin: 1.25rem auto 0;
  padding: 0 0.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-footer nav {
  display: inline-block;
  background: rgba(255,255,255,0.65);
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  backdrop-filter: blur(10px);
}

.site-footer a {
  color: var(--blue-main);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
  text-decoration: underline;
}


/* =========================
   RAUMINVENTAR
========================= */

.grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-m);
}

.topbar {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-m);
  gap: var(--space-s);
  flex-wrap: wrap;
}

.panel {
  padding: var(--space-m);
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.9);
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow);
}

.item {
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.logout {
  position: absolute;
  top: 10px;
  right: 10px;
}

.row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.icon-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.icon-picker img {
  width: 60px;
  cursor: pointer;
  border-radius: 8px;
  padding: 5px;
  transition: 0.2s;
}

.icon-picker img:hover {
  background: #eee;
  transform: scale(1.1);
}

.room-stage {
  position: relative;
  width: 100%;
  height: 400px;
  border: 1px solid #ccc;

  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;

  touch-action: none; /* wichtig für Mobile */
}

.room-object {
  position: absolute;
  width: 60px;
  cursor: grab;
  transition: transform 0.08s ease;
}

.room-object:hover {
  transform: scale(1.08);
}

.room-object.highlight {
  outline: 3px solid orange;
  transform: scale(1.1);
}

.room-object.dragging {
  cursor: grabbing;
  opacity: 0.85;
}

.room-object.active {
  outline: 2px solid var(--blue-accent);
}

.icon-picker img.selected {
  outline: 2px solid var(--blue-accent);
  background: #e6f0ff;
}

#itemsList div {
  padding: 6px;
  border-radius: 6px;
  transition: 0.15s;
}

#itemsList div:hover {
  background: #f0f4ff;
}

.room-object.jump {
  transform: scale(1.25);
  transition: transform 0.2s;
}