/* ==========================================
   RE Polaroid Wall - Authentischer Polaroid-Look
   ========================================== */

/* Google Fonts - Handschrift-Style */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&display=swap');

/* CSS Custom Properties */
:root {
  --re-polaroid-bg: #ffffff;
  --re-polaroid-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  --re-polaroid-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.25);
  --re-polaroid-transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================
   Container
   ========================================== */
.re-polaroid-wall {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: -40px;
  padding: 80px 20px;
  width: 100%;
  position: relative;
  min-height: 500px;
}

/* ==========================================
   Einzelnes Polaroid - Leicht schief und überlappend
   ========================================== */
.re-polaroid {
  position: relative;
  background: var(--re-polaroid-bg);
  padding: 20px 20px 50px 20px;
  box-shadow: var(--re-polaroid-shadow);
  transition: var(--re-polaroid-transition);
  cursor: default;
  max-width: 280px;
  width: 100%;
  transform-origin: center center;
  margin: 0 -25px;
}

/* Standard Rotationen für schiefen Look - wie im Screenshot */
.re-polaroid:nth-child(1) {
  transform: rotate(-8deg);
  z-index: 1;
  margin-top: 20px;
}

.re-polaroid:nth-child(2) {
  transform: rotate(5deg);
  z-index: 3;
  margin-top: -30px;
}

.re-polaroid:nth-child(3) {
  transform: rotate(-6deg);
  z-index: 2;
  margin-top: 40px;
}

.re-polaroid:nth-child(4) {
  transform: rotate(7deg);
  z-index: 1;
  margin-top: 10px;
}

/* Polaroid Frame (Bildcontainer) */
.re-polaroid-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8f8f8;
}

/* Bild - Immer Cover */
.re-polaroid-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center;
  display: block;
  transition: transform 0.4s ease;
}

/* ==========================================
   Bildunterschrift - Handschrift Style
   ========================================== */
.re-polaroid-caption {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-weight: 500;
  color: #333333;
  text-align: center;
  margin-top: 15px;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

/* ==========================================
   Video Support
   ========================================== */
.re-polaroid-video {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.re-polaroid-video-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.re-polaroid-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--re-polaroid-transition);
  z-index: 5;
}

.re-polaroid-play-button i {
  color: #ffffff;
  font-size: 24px;
  margin-left: 3px;
}

.re-polaroid-video:hover .re-polaroid-play-button {
  background: rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

/* ==========================================
   Hover Animation - Deaktiviert
   ========================================== */
/* Hover-Effekt wurde entfernt */

/* ==========================================
   Wind Animation - Sanft wehend
   ========================================== */
@keyframes re-polaroid-sway-1 {
  0%, 100% {
    transform: rotate(-8deg) translateY(20px);
  }
  25% {
    transform: rotate(-7deg) translateY(18px);
  }
  50% {
    transform: rotate(-8deg) translateY(20px);
  }
  75% {
    transform: rotate(-9deg) translateY(22px);
  }
}

@keyframes re-polaroid-sway-2 {
  0%, 100% {
    transform: rotate(5deg) translateY(-30px);
  }
  30% {
    transform: rotate(4deg) translateY(-28px);
  }
  60% {
    transform: rotate(6deg) translateY(-32px);
  }
}

@keyframes re-polaroid-sway-3 {
  0%, 100% {
    transform: rotate(-6deg) translateY(40px);
  }
  20% {
    transform: rotate(-5deg) translateY(38px);
  }
  70% {
    transform: rotate(-7deg) translateY(42px);
  }
}

@keyframes re-polaroid-sway-4 {
  0%, 100% {
    transform: rotate(7deg) translateY(10px);
  }
  35% {
    transform: rotate(6deg) translateY(8px);
  }
  65% {
    transform: rotate(8deg) translateY(12px);
  }
}

.re-polaroid-wall-wind .re-polaroid:nth-child(1) {
  animation: re-polaroid-sway-1 5s ease-in-out infinite;
}

.re-polaroid-wall-wind .re-polaroid:nth-child(2) {
  animation: re-polaroid-sway-2 6s ease-in-out infinite;
}

.re-polaroid-wall-wind .re-polaroid:nth-child(3) {
  animation: re-polaroid-sway-3 5.5s ease-in-out infinite;
}

.re-polaroid-wall-wind .re-polaroid:nth-child(4) {
  animation: re-polaroid-sway-4 6.5s ease-in-out infinite;
}

/* ==========================================
   Responsive Design - Immer nebeneinander, aber kleiner
   ========================================== */
@media (max-width: 1024px) {
  .re-polaroid-wall {
    padding: 30px 15px;
    gap: -25px;
    min-height: 400px;
  }
  
  .re-polaroid {
    max-width: 240px;
    margin: 0 -20px;
  }

  .re-polaroid-image-wrapper {
    height: 240px;
  }
  
  .re-polaroid-caption {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .re-polaroid-wall {
    flex-wrap: nowrap;
    padding: 20px 10px;
    gap: -15px;
    justify-content: center;
    min-height: 300px;
  }
  
  .re-polaroid {
    min-width: 140px;
    max-width: 170px;
    margin: 0 -12px;
  }

  .re-polaroid:nth-child(1) {
    margin-top: 10px;
  }

  .re-polaroid:nth-child(2) {
    margin-top: -15px;
  }

  .re-polaroid:nth-child(3) {
    margin-top: 20px;
  }

  .re-polaroid:nth-child(4) {
    margin-top: 5px;
  }

  .re-polaroid-image-wrapper {
    height: 170px;
  }
  
  .re-polaroid-caption {
    font-size: 16px;
    padding: 8px;
  }
  
  .re-polaroid-play-button {
    width: 50px;
    height: 50px;
  }
  
  .re-polaroid-play-button i {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .re-polaroid-wall {
    gap: -8px;
    padding: 15px 5px;
  }

  .re-polaroid {
    min-width: 90px;
    max-width: 110px;
    margin: 0 -8px;
    padding: 12px 12px 35px 12px;
  }

  .re-polaroid-image-wrapper {
    height: 110px;
  }
  
  .re-polaroid-caption {
    font-size: 13px;
    padding: 6px;
    margin-top: 6px;
    min-height: 28px;
  }
  
  .re-polaroid-play-button {
    width: 40px;
    height: 40px;
  }
  
  .re-polaroid-play-button i {
    font-size: 16px;
  }
}

/* ==========================================
   Performance Optimizations
   ========================================== */
.re-polaroid {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Reduzierte Animationen für Barrierefreiheit */
@media (prefers-reduced-motion: reduce) {
  .re-polaroid-wall-wind .re-polaroid {
    animation: none !important;
  }
  
  .re-polaroid-wall-hover .re-polaroid:hover {
    transform: none;
  }
  
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================
   Placeholder (Editor)
   ========================================== */
.re-polaroid-placeholder {
  padding: 40px;
  text-align: center;
  background: #f5f5f5;
  border: 2px dashed #ddd;
  border-radius: 8px;
}

.re-polaroid-placeholder p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

/* ==========================================
   Video Modal/Lightbox Styles
   ========================================== */
.re-polaroid-video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.re-polaroid-video-modal.active {
  opacity: 1;
  visibility: visible;
}

.re-polaroid-video-modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
}

.re-polaroid-video-modal iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.re-polaroid-video-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 30px;
  cursor: pointer;
  padding: 10px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.re-polaroid-video-modal-close:hover {
  transform: scale(1.2);
}
