/* Schnörkelschrift (ähnlich Almonde) + Fallbacks */
@import url('https://fonts.googleapis.com/css2?family=Allura&family=Great+Vibes&family=Dancing+Script:wght@700&display=swap');

:root{
  --gold: #947a27;
  --gold-dark: #7d651f;
  --gold-light: #fae6b9;
  --text: #111111;
  --muted: #555555;
  --border: #e9e9e9;
  --bg: #ffffff;
}

/* Grundlayout */
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Allura', 'Great Vibes', 'Dancing Script', cursive;
  margin: 0;
  min-height: 100%;
}

/* Karten/Container */
.container-card, .gal-card {
  max-width: 560px;
  margin: 36px auto 28px auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0,0,0,.06);
  padding: 26px 22px 34px;
}

/* Headings & Texte */
h1, h2, .lead, .small-note {
  font-family: 'Allura', 'Great Vibes', 'Dancing Script', cursive;
  text-align: center;
  color: var(--text);
  letter-spacing: .02em;
}
h2 { font-size: 2.4rem; font-weight: 700; margin: 0 0 .75rem; }
.lead { font-size: 1.6rem; color: var(--muted); margin-bottom: 1.1rem; }
.small-note { font-size: 1.35rem; color: var(--gold); margin-top: 1.2rem; }

/* Akzent-Icons */
.heart, .camera-emoji { 
  color: var(--gold); 
  display: inline-block; 
  animation: pulse 1.6s infinite;
}
.heart { font-size: 2rem; }
.camera-emoji { font-size: 1.4rem; margin-right: .35rem; }
@keyframes pulse { 0%{transform:scale(1)} 50%{transform:scale(1.08)} 100%{transform:scale(1)} }

/* Buttons (Bootstrap Overrides) */
.btn {
  font-family: 'Allura', 'Great Vibes', 'Dancing Script', cursive;
  font-weight: 700;
  letter-spacing: .01em;
}
.btn-primary {
  background-color: var(--gold) !important;
  border-color: var(--gold) !important;
  color: #fff !important;
  box-shadow: 0 .35rem .85rem rgba(148,122,39,.18);
}
.btn-primary:hover {
  background-color: var(--gold-dark) !important;
  border-color: var(--gold-dark) !important;
}
.btn-primary:focus, .btn-primary:active, .btn-primary:focus-visible {
  box-shadow: 0 0 0 .25rem rgba(148,122,39,.28) !important;
}
.btn-outline-primary {
  color: var(--gold) !important;
  border-color: var(--gold) !important;
}
.btn-outline-primary:hover {
  background-color: var(--gold) !important;
  color: #fff !important;
  border-color: var(--gold) !important;
}
.btn-lg { padding: .7rem 1.4rem; font-size: 1.5rem; }
.rounded-pill { border-radius: 999px !important; }

/* Upload-Label (Button für hidden file input) */
label.btn-upload { cursor: pointer; }

/* Progressbar */
.progress {
  height: 8px;
  background-color: #f3f3f3;
  border-radius: 999px;
}
.progress-bar { background-color: var(--gold); }

/* Zufallsbild */
.preview-img {
  width: 160px; height: 160px; object-fit: cover;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: #fffdf3;
  box-shadow: 0 2px 12px rgba(148,122,39,.10);
}

/* Galerie */
.gal-card { max-width: 1200px; }
.gallery-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.grid {
  display: grid;
  grid-gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 16px;
}
.cell {
  background: #fffef9;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 10px 16px;
  text-align: center;
  box-shadow: 0 1px 10px rgba(0,0,0,.04);
}
.cell img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  background: #fffdf3;
}

/* Video-spezifische Styles */
.video-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  overflow: hidden;
  background: #fffdf3;
}

.video-player {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.video-overlay:hover {
  background: rgba(0, 0, 0, 0.5);
}

.play-icon {
  font-size: 3rem;
  color: var(--gold);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  animation: pulse-play 2s infinite;
}

@keyframes pulse-play {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Zufallsanzeige für Videos */
.preview-video {
  width: 160px; 
  height: 160px; 
  object-fit: cover;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: #fffdf3;
  box-shadow: 0 2px 12px rgba(148,122,39,.10);
}

.preview-media-container {
  position: relative;
  display: inline-block;
}

.preview-media-container .video-overlay {
  border-radius: 14px;
}

.preview-media-container .play-icon {
  font-size: 2rem;
}

/* Abstände mobil */
@media (max-width: 576px) {
  .container-card { margin: 18px 12px 24px; padding: 22px 16px 28px; }
  .gal-card { margin: 18px 10px 24px; padding: 16px 12px 24px; }
  h2 { font-size: 2rem; }
  .lead { font-size: 1.45rem; }
  
  /* Video-Anpassungen für mobil */
  .video-player {
    max-height: 180px;
  }
  
  .play-icon {
    font-size: 2.5rem;
  }
  
  .preview-video {
    width: 140px;
    height: 140px;
  }
  
  .preview-media-container .play-icon {
    font-size: 1.8rem;
  }
}

/* Responsive Grid-Anpassungen */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    grid-gap: 12px;
  }
  
  .cell {
    padding: 10px 8px 12px;
  }
  
  .cell img, .video-player {
    max-height: 160px;
  }
}

/* Verbesserungen für Video-Performance */
.video-player[preload="metadata"] {
  background: #fffdf3;
}

/* Hover-Effekte für Videos */
.video-container:hover .video-overlay {
  background: rgba(148, 122, 39, 0.2);
}

.video-container:hover .play-icon {
  color: #ffffff;
  transform: scale(1.1);
}

/* Video-Thumbnail Styles */
.video-thumbnail-container {
  position: relative;
  cursor: pointer;
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  overflow: hidden;
  background: #fffdf3;
}

.video-thumbnail {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.video-placeholder {
  width: 100%;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fffdf3, #faf7e8);
  color: var(--gold);
}

.video-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.video-text {
  font-size: 1.2rem;
  font-weight: bold;
  font-family: 'Allura', 'Great Vibes', 'Dancing Script', cursive;
}

.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.video-thumbnail-container:hover .video-play-overlay {
  background: rgba(148, 122, 39, 0.4);
}

.video-thumbnail-container .play-icon {
  font-size: 3rem;
  color: var(--gold);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  animation: pulse-play 2s infinite;
}

.video-thumbnail-container:hover .play-icon {
  color: #ffffff;
  transform: scale(1.1);
}

/* Gallery-Image Styles */
.gallery-image {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery-image:hover {
  transform: scale(1.05);
}

/* Modal Styles */
.video-modal {
  width: 100%;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.modal-content {
  border-radius: 15px;
  border: 2px solid var(--gold);
}

.modal-header {
  background: var(--gold-light);
  border-bottom: 1px solid var(--gold);
  border-radius: 13px 13px 0 0;
}

.modal-title {
  color: var(--gold-dark);
  font-family: 'Allura', 'Great Vibes', 'Dancing Script', cursive;
  font-size: 1.8rem;
  font-weight: bold;
}

/* Mobile Anpassungen für Videos */
@media (max-width: 576px) {
  .video-placeholder {
    height: 160px;
  }
  
  .video-icon {
    font-size: 3rem;
  }
  
  .video-text {
    font-size: 1rem;
  }
  
  .video-thumbnail-container .play-icon {
    font-size: 2.5rem;
  }
  
  .video-modal {
    max-height: 50vh;
  }
}

@media (max-width: 768px) {
  .video-thumbnail, .video-placeholder {
    max-height: 160px;
    height: 160px;
  }
}

/* Top Badge */
.top-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, var(--gold), #b89a3a);
  color: #fff;
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 700;
  letter-spacing: .03em;
  font-family: 'Allura', 'Great Vibes', 'Dancing Script', cursive;
  box-shadow: 0 2px 8px rgba(148,122,39,.25);
}

/* Comment Styles */
.comment-form {
  margin-top: 8px;
}

.comments {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 0;
}

.comment-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  border-left: 3px solid var(--gold);
}

.comment-item strong {
  color: var(--gold-dark);
  font-weight: 600;
}

.comment-date {
  font-size: 0.75rem;
  color: #6c757d;
  float: right;
}

/* Cell positioning fix */
.cell {
  position: relative;
}

/* Vote badge transitions */
.badge {
  transition: all 0.3s ease;
}

/* Button disabled state */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Smooth image transitions for carousel */
.preview-img {
  transition: opacity 0.8s ease-in-out;
}

/* Fade in animation for new images */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.preview-img.fade-in {
  animation: fadeIn 0.8s ease-out;
}

/* Improve comment display */
.comments {
  border-top: 1px solid #e9ecef;
  margin-top: 8px;
  padding-top: 8px;
}

.comment-item {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translateY(-10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Better form styling */
.comment-form .input-group {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
}
