/* Fragebogen Galerie Styles */

/* SVG Icons verstecken (wie in galerie.css) */
.sprite-svg {
  display: none;
}

/* Content with Timeline Layout */
.content-with-timeline {
  display: flex;
  gap: 40px;
  position: relative;
  width: 100%;
}

/* Timeline Sidebar */
.timeline-sidebar {
  position: sticky;
  top: 100px;
  width: 160px;
  height: fit-content;
  max-height: calc(100vh - 150px); /* Limit height to viewport */
  min-height: 400px;
  padding: 40px 15px;
  order: 2;
  margin-left: 30px;
  overflow-y: auto; /* Scrollable when content exceeds height */
  overflow-x: hidden;
}

/* Custom scrollbar for timeline */
.timeline-sidebar::-webkit-scrollbar {
  width: 4px;
}

.timeline-sidebar::-webkit-scrollbar-track {
  background: rgba(31, 143, 168, 0.1);
  border-radius: 2px;
}

.timeline-sidebar::-webkit-scrollbar-thumb {
  background: var(--farbeTürkis1);
  border-radius: 2px;
  opacity: 0.5;
}

.timeline-sidebar::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
}

/* Vertical Line */
.timeline-vertical-line {
  position: absolute;
  left: 20px;
  top: 50px;
  bottom: 50px;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(31, 143, 168, 0.2) 5%,
    rgba(31, 143, 168, 0.3) 50%,
    rgba(31, 143, 168, 0.2) 95%,
    transparent 100%);
}

/* Timeline Items Container */
.timeline-items {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 35px; /* Slightly reduced gap for more items */
}

/* Timeline Node */
.timeline-node {
  display: flex;
  align-items: center;
  text-decoration: none;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.timeline-node:hover {
  transform: translateX(-5px);
}

/* Timeline Node Dot */
.timeline-node-dot {
  position: absolute;
  left: -6px;
  width: 10px;
  height: 10px;
  background: white;
  border: 2px solid rgba(31, 143, 168, 0.4);
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 2;
}

.timeline-node.active .timeline-node-dot {
  width: 14px;
  height: 14px;
  left: -8px;
  background: var(--farbeTürkis1);
  border-color: var(--farbeTürkis1);
  box-shadow: 0 0 10px rgba(31, 143, 168, 0.4);
}

.timeline-node:hover .timeline-node-dot {
  width: 12px;
  height: 12px;
  left: -7px;
  border-color: var(--farbeTürkis1);
  background: rgba(31, 143, 168, 0.2);
}

/* Timeline Label */
.timeline-node-label {
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.timeline-node:hover .timeline-node-label {
  background: rgba(31, 143, 168, 0.1);
  transform: translateX(3px);
}

/* Timeline Month & Year */
.timeline-month {
  font-size: 13px;
  font-weight: 600;
  color: var(--farbe3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.timeline-year {
  font-size: 11px;
  font-weight: 400;
  color: rgba(31, 143, 168, 0.7);
}

.timeline-node:hover .timeline-month {
  color: var(--farbeTürkis1);
}

.timeline-node:hover .timeline-year {
  color: var(--farbeTürkis1);
}

/* Active State */
.timeline-node.active .timeline-node-label {
  background: rgba(31, 143, 168, 0.15);
  font-weight: 700;
}

.timeline-node.active .timeline-month {
  color: var(--farbeTürkis1);
}

/* Fragebogen Grid Adjustment */
.content-with-timeline .galerie-images {
  flex: 1;
  order: 1;
}

/* Month Separator in Grid */
.month-separator {
  width: 100%;
  margin: 30px 0 20px;
}

.month-separator:first-child {
  margin-top: 0;
}

.month-separator h3 {
  /* Inherits default h3 styling from style.css */
  /* color: darkslategrey is already set globally for h3 */
}

/* Responsive Timeline and Layout */
@media (max-width: 1024px) {
  .content-with-timeline {
    display: flex;
    gap: 20px;
  }
  
  /* Timeline stays vertical but gets narrower */
  .timeline-sidebar {
    width: 120px;
    min-height: 300px;
    padding: 20px 10px;
    margin-left: 10px;
  }
  
  .timeline-node-label {
    padding: 4px 6px;
    font-size: 11px;
  }
  
  .timeline-month {
    font-size: 11px;
  }
  
  .timeline-year {
    font-size: 10px;
  }
  
  /* Adjust fragebogen items - fewer columns to accommodate timeline */
  .fragebogen-item {
    width: calc(50% - 20px);
  }
}

@media (max-width: 768px) {
  /* Keep timeline vertical but make it narrower */
  .timeline-sidebar {
    width: 100px;
    padding: 15px 5px;
    margin-left: 5px;
    max-height: calc(100vh - 200px); /* Adjust for mobile viewport */
  }
  
  .timeline-items {
    gap: 25px;
  }
  
  .timeline-node-label {
    padding: 3px 5px;
    font-size: 10px;
  }
  
  .timeline-month {
    font-size: 10px;
    letter-spacing: 0;
  }
  
  .timeline-year {
    font-size: 9px;
  }
  
  .timeline-vertical-line {
    left: 15px;
  }
  
  .timeline-node-dot {
    left: -6px;
    width: 8px;
    height: 8px;
  }
  
  /* Fragebogen grid - only 1 column on small tablets */
  .fragebogen-item {
    width: 100%;
    margin: 0 0 10px 0;
  }
  
  /* Single column grid */
  .frageboegen-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .fragebogen-datum {
    font-size: 11px;
    padding: 6px 3px;
    letter-spacing: 0;
    line-height: 1.2;
    min-height: 32px;
  }
  
  .month-separator {
    margin: 20px 0 15px;
    padding: 8px;
  }
  
  .month-separator h3 {
    font-size: 1.1em;
    letter-spacing: 1px;
  }
  
  /* Container adjustments */
  .container-galerie {
    padding: 10px;
  }
  
  .einleitung-text {
    font-size: 14px;
    padding: 0 10px;
  }
}

@media (max-width: 480px) {
  /* Keep vertical layout on mobile */
  .content-with-timeline {
    flex-direction: row;
    position: relative;
  }
  
  /* Timeline stays vertical but very narrow */
  .timeline-sidebar {
    width: 80px;
    padding: 10px 3px;
    margin-left: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 150px);
    order: 2;
  }
  
  /* Keep timeline items vertical */
  .timeline-items {
    flex-direction: column;
    gap: 20px;
  }
  
  .timeline-vertical-line {
    left: 12px;
    width: 1px;
  }
  
  .timeline-node {
    flex-shrink: 0;
  }
  
  .timeline-node-dot {
    left: -5px;
    width: 6px;
    height: 6px;
    border-width: 1.5px;
  }
  
  .timeline-node-label {
    margin-left: 12px;
    padding: 2px 4px;
    font-size: 9px;
  }
  
  .timeline-month {
    font-size: 9px;
    display: block;
  }
  
  .timeline-year {
    font-size: 8px;
    display: block;
    margin-top: 1px;
  }
  
  /* Mobile list layout for fragebögen */
  .frageboegen-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 10px 15px;
    width: calc(100% - 85px); /* Account for timeline width */
  }
  
  /* Fragebogen as simple list item on mobile */
  .fragebogen-item {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    animation: none;
    background: transparent;
    padding: 8px 0;
    border-bottom: 1px solid rgba(31, 143, 168, 0.1);
  }
  
  .fragebogen-item:hover {
    transform: none;
    box-shadow: none;
    background: transparent;
  }
  
  /* Simple text link */
  .fragebogen-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    text-decoration: none;
  }
  
  /* Date as simple text */
  .fragebogen-datum {
    background: transparent;
    padding: 0;
    margin: 0;
    text-align: left;
    font-size: 14px;
    font-weight: 400;
    color: var(--farbe3);
    min-height: auto;
    line-height: 1.5;
    flex: 1;
  }
  
  .fragebogen-item:hover .fragebogen-datum {
    color: var(--farbeTürkis1);
    background: transparent;
    text-decoration: underline;
  }
  
  /* Simple document icon on the right */
  .fragebogen-item a::after {
    content: "📄";
    font-size: 18px;
    flex-shrink: 0;
    margin-left: 10px;
    opacity: 0.7;
  }
  
  .fragebogen-item:hover a::after {
    opacity: 1;
  }
  
  /* Adjust main gallery container */
  .galerie-images {
    flex: 1;
  }
  
  /* Month separator in list mode */
  .month-separator {
    margin: 18px 0 8px;
    padding: 0;
    background: transparent;
    border: none;
    width: 100%;
  }
  
  .month-separator h3 {
    font-size: 0.85em;
    margin: 0;
    color: rgba(31, 143, 168, 0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding-left: 0;
  }
  
  /* Adjust header text */
  .Blocküberschrift {
    font-size: 1.5em;
  }
  
  /* Fix footer spacing on mobile */
  body {
    padding-bottom: 60px;
  }
  
  .item13.item {
    font-size: 12px;
    padding: 8px;
  }
}

/* Landscape mode adjustments */
@media (max-width: 812px) and (orientation: landscape) {
  .fragebogen-item {
    width: calc(33.333% - 15px);
  }
  
  .timeline-sidebar {
    padding: 8px;
    margin-bottom: 10px;
  }
}

/* Scroll-Anzeige bei Focus */
.fragebogen-item:target {
  animation: highlight 1s ease;
}

@keyframes highlight {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(31, 143, 168, 0.5);
  }
}

/* Container nutzt galerie-styles */
.container-galerie {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  padding: 15px;
  flex-direction: column;
}

.item-galerie {
  flex: 1;
  min-width: 100%;
  margin-bottom: 20px;
}

/* Grid für Fragebogen-Thumbnails */
.frageboegen-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: flex-start;
  padding: 10px 0;
}

.galerie-images {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
}

/* Einzelner Fragebogen */
.fragebogen-item {
  margin: 5px;
  transition: all 0.3s ease;
  width: calc(25% - 20px); /* 4 Spalten auf Desktop */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fragebogen-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(31, 143, 168, 0.2);
}

/* Already handled in responsive section above */

.fragebogen-item a {
  display: block;
  text-decoration: none;
}

.fragebogen-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Mobile override - must come after general rule */
@media (max-width: 480px) {
  .fragebogen-item img {
    display: none !important;
  }
}

/* Datum unter dem Fragebogen */
.fragebogen-datum {
  padding: 8px 4px;
  margin: 0;
  text-align: center;
  font-weight: 500;
  color: var(--farbe3);
  background: rgba(230, 230, 230, 0.95);
  font-size: 13px;
  letter-spacing: 0.5px;
  white-space: normal; /* Allow text to wrap */
  line-height: 1.3;
  min-height: 36px; /* Ensure consistent height */
}

/* Lightbox Anpassungen für Fragebögen */
.zoom-image-fragebogen {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Einleitungstext Styling */
.einleitung-text {
  color: var(--farbe3);
  line-height: 1.6;
  margin: 20px 0;
  text-align: center;
  font-size: 16px;
  padding: 0 20px;
}

/* Überschrift Styling */
.galerie-section-title {
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
}

.Blocküberschrift {
  color: var(--farbeTürkis1);
  font-size: 2em;
}

/* Animation für Seitenaufruf */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fragebogen-item {
  animation: fadeIn 0.5s ease-out;
  animation-fill-mode: both;
}

/* Verzögerte Animation für einzelne Items */
.fragebogen-item:nth-child(1) { animation-delay: 0.1s; }
.fragebogen-item:nth-child(2) { animation-delay: 0.2s; }
.fragebogen-item:nth-child(3) { animation-delay: 0.3s; }
.fragebogen-item:nth-child(4) { animation-delay: 0.4s; }
.fragebogen-item:nth-child(5) { animation-delay: 0.5s; }
.fragebogen-item:nth-child(6) { animation-delay: 0.6s; }
.fragebogen-item:nth-child(7) { animation-delay: 0.7s; }
.fragebogen-item:nth-child(8) { animation-delay: 0.8s; }

/* Hover-Effekt für Datum */
.fragebogen-item:hover .fragebogen-datum {
  color: var(--farbeTürkis1);
  background: rgba(240, 240, 240, 1);
  font-weight: 700;
}

/* Footer am unteren Rand fixieren - gleiche Farbe wie index.html */
.item13.item {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: lightblue; /* gleiche Farbe wie index.html durch .item Klasse */
  padding: 10px;
  text-align: center;
  color: var(--farbe4);
  z-index: 100;
  border-radius: 0; /* Kein border-radius am unteren Rand */
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2); /* Schatten nach oben */
}

/* Body padding-bottom für fixen Footer */
body {
  padding-bottom: 50px;
}

/* Lightbox Styles aus galerie.css übernommen */
.zoom-wrapper {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
}

.zoom-wrapper:target {
  display: flex;
}

.zoom-wrapper__image {
  position: relative;
  width: 80%;
  max-width: 1200px;
  height: 100%;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.cell {
  box-flex: 1;
  flex: 1 1 auto;
}

/* Navigation Arrows */
.navigation-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  perspective: 1000px;
  perspective-origin: 100% 50%;
  z-index: 10000;
}

.navigation-arrow__prev {
  left: 0;
}

.navigation-arrow__next {
  right: 0;
}

.navigation-arrow__image {
  position: absolute;
  width: 100px;
  height: 100px;
  overflow: hidden;
  transition: transform 0.3s;
}

.navigation-arrow__prev .navigation-arrow__image {
  left: 40px;
  transform: rotateY(90deg);
  transform-origin: 0% 50%;
}

.navigation-arrow__next .navigation-arrow__image {
  right: 40px;
  transform: rotateY(-90deg);
  transform-origin: 100% 50%;
}

.navigation-arrow__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.navigation-arrow__prev:hover .navigation-arrow__image,
.navigation-arrow__next:hover .navigation-arrow__image {
  transform: rotateY(0deg);
}

.navigation-arrow__icon {
  position: relative;
  display: block;
  width: 40px;
  height: 100px;
  padding: 6px;
  background-color: #ffffff;
}

.navigation-arrow__icon svg.icon {
  top: 50%;
  transform: translateY(-50%);
  fill: #000000;
  position: relative;
  stroke-width: 2;
  stroke: #000000;
}

/* Close Button */
.zoom-wrapper__close {
  position: fixed;
  top: 20px;
  right: 35px;
  z-index: 10001;
  color: #ffffff;
  font-size: 40px;
  font-weight: 300;
  text-decoration: none;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s;
}

.zoom-wrapper__close:hover {
  transform: scale(1.2);
  color: var(--farbeTürkis1);
}

/* MOBILE AND TABLET OVERRIDES - MUST BE LAST IN FILE */
@media screen and (max-width: 768px) {
  /* Force hide images on mobile/tablet */
  body .fragebogen-item img {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
  }
  
  /* Transform to simple text list */
  body .frageboegen-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 10px 15px !important;
    width: calc(100% - 85px) !important;
  }
  
  body .fragebogen-item {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(31, 143, 168, 0.1) !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }
  
  body .fragebogen-item a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 0 !important;
    text-decoration: none !important;
  }
  
  /* Date as simple text */
  body .fragebogen-item .fragebogen-datum {
    display: block !important;
    visibility: visible !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: var(--farbe3) !important;
    min-height: auto !important;
    line-height: 1.5 !important;
    flex: 1 !important;
  }
  
  body .fragebogen-item:hover .fragebogen-datum {
    color: var(--farbeTürkis1) !important;
    text-decoration: underline !important;
  }
  
  /* Add simple icon on the right */
  body .fragebogen-item a::after {
    content: "📄" !important;
    font-size: 18px !important;
    flex-shrink: 0 !important;
    margin-left: 10px !important;
    opacity: 0.6 !important;
  }
  
  body .fragebogen-item:hover a::after {
    opacity: 1 !important;
  }
  
  /* Month separators */
  body .month-separator {
    margin: 20px 0 10px !important;
    padding: 5px 0 !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
  }
  
  body .month-separator h3 {
    font-size: 0.85em !important;
    margin: 0 !important;
    color: rgba(31, 143, 168, 0.7) !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    padding-left: 0 !important;
  }
}