/**
 * Layout Styles
 * Grid und Flexbox Layouts für Desktop
 */

/* Desktop body padding für Zeitslider und Buttons */
body {
  padding-left: 100px;
  --page-bottom-padding: 50px;
  padding-bottom: var(--page-bottom-padding);
}

/* Container für Dachboden mit Button */
#location-dachboden-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: calc(5vh - 5px);
  margin-bottom: 20px;
}

#location-dachboden-container .verschiebe-button {
  align-self: center; /* Vertikal zum Dachboden zentriert */
}

/* Wrapper für Dachboden */
#location-dachboden-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Dachboden Dropdown */
#location-dachboden-dropdown {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.dachboden-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  background: white;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

/* Location-spezifische Farben für Toggle-Button */
.dachboden-toggle[class*=" "] {
  background: var(--location-bg);
  color: var(--location-color);
  border-color: var(--location-bg);
}

.dachboden-toggle:hover {
  border-color: #999;
}

.dachboden-erste-location {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

.dachboden-erste-location img,
.dachboden-erste-location svg {
  height: 30px;
  width: auto;
  margin: 0;
}

.toggle-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

#location-dachboden-dropdown:not(.collapsed) .toggle-icon {
  transform: rotate(180deg);
}

/* Dachboden-Liste (ausklappbar) */
.dachboden-liste {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border: none;
  border-radius: 0 0 6px 6px;
}

#location-dachboden-dropdown:not(.collapsed) .dachboden-liste {
  max-height: 400px;
  overflow-y: auto;
  border: 2px solid #ccc;
  border-top: none;
}

.dachboden-liste-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: opacity 0.2s ease;
  background: var(--location-bg);
  color: var(--location-color);
}

.dachboden-liste-item:last-child {
  border-bottom: none;
}

.dachboden-liste-item:hover {
  opacity: 0.8;
}

.dachboden-liste-item img,
.dachboden-liste-item svg {
  height: 30px;
  width: auto;
  max-width: 100px;
  margin: 0;
}

.dachboden-liste-item span {
  font-weight: 500;
}

/* Spezielle Hintergründe für Logos - Toggle und Liste konsistent */
.dachboden-liste-item.Aalhaus,
.dachboden-toggle.Aalhaus {
  background: white;
}

.dachboden-liste-item.Nochtspeicher,
.dachboden-toggle.Nochtspeicher {
  background: white;
  color: #a60f43;
  border-color: #a60f43;
}

.dachboden-liste-item.Indra,
.dachboden-toggle.Indra {
  background: #fafafa;
  color: #990000;
  border-color: #990000;
}

.dachboden-liste-item.Chronologie,
.dachboden-toggle.Chronologie {
  background: #e8f4e8;
  color: #2d5a2d;
}

/* Container für Speicher mit Buttons */
#location-speicher-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.speicher-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: center; /* Vertikal zum Speicher zentriert */
}

/* Location-Speicher */
#location-speicher {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  padding-right: 75px; /* Platz für Einstellungen-Button rechts */
  min-height: 100px; /* Mindesthöhe damit beide Buttons Platz haben */
}

/* Container für Grid mit Button */
#konzerte-container {
  display: flex;
  align-items: flex-start; /* Button oben ausrichten */
  gap: 10px;
}

/* Buttons */
.bereich-button,
.verschiebe-button {
  background: white;
  border: 2px solid #ccc;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.bereich-button:hover,
.verschiebe-button:hover {
  background: #f5f5f5;
  border-color: #999;
}

.bereich-button:active,
.verschiebe-button:active {
  background: #eee;
}

.verschiebe-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Konzerte-Grid */
#konzerte {
  flex: 1;
  min-width: 0; /* Erlaubt Flex-Item zu schrumpfen */
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, max-content));
  justify-content: start;
  padding-right: 10px;
}

/* Vertikales Scrollen: Alle Spalten nebeneinander */
body.vertikales-scrollen #konzerte-container {
  overflow-x: auto;
}

body.vertikales-scrollen #konzerte {
  grid-auto-flow: column;
  grid-template-columns: none;
  width: max-content;
}

body.vertikales-scrollen #grid-nach-speicher {
  position: sticky;
  left: 0;
  z-index: 10;
}

/* Location-Spalte im Grid */
.location-spalte {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
  width: 100%;
  overflow-wrap: anywhere;
}

/* Suchspalte braucht Mindestbreite für das Inputfeld */
.location-spalte.Suche {
  min-width: 250px;
}

/* Konzerte-Liste in einer Spalte */
.location-konzerte {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
