/*
 * Hochzeit Dutschke – Professionelles Design v2
 * Elegantes, schnelles und responsives Layout
 * Mit Lazy Loading, optimierten Animationen und Video-Support
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ===== CSS Custom Properties ===== */
:root {
  --primary-bg: #faf9f7;
  --accent: #c5a880;
  --accent-light: #e8ddd0;
  --accent-dark: #a68a5b;
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --brand-dark: #6b2d4e;
  --brand-dark-hover: #8a3d65;
  --brand-light: #fdf5f8;
  --card-bg: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 50px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--primary-bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 80px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Logo Header (versteckt) ===== */
.header-logo {
  display: none !important;
}

/* ===== Topbar ===== */
.topbar {
  background: linear-gradient(135deg, var(--brand-dark) 0%, #4a1e36 50%, #3d1a2e 100%);
  color: #fff;
  text-align: center;
  padding: 1.1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(107, 45, 78, 0.3);
}

.topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer-bg 8s linear infinite;
}

@keyframes shimmer-bg {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(50%); }
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, #e8d5b8, #fff, #e8d5b8);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer-text 5s linear infinite;
}

@keyframes shimmer-text {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 1px;
}

.hero .portrait {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 4px 20px rgba(197, 168, 128, 0.25);
  margin: 0 auto 1.2rem;
  transition: var(--transition);
  animation: fadeInScale 0.7s ease-out;
}

.hero .portrait:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(197, 168, 128, 0.35);
}

.hero h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 0.6rem;
  animation: fadeInUp 0.7s ease-out 0.15s both;
}

.hero p {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 300;
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.7;
  animation: fadeInUp 0.7s ease-out 0.3s both;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Main Content ===== */
main {
  padding: 2rem 1.5rem;
  max-width: 900px;
  margin: 0 auto 5rem;
}

/* ===== Bottom Navigation ===== */
.navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  box-shadow: 0 -1px 20px rgba(0,0,0,0.06);
  z-index: 1000;
  border-top: 1px solid rgba(0,0,0,0.04);
}

.nav-item {
  flex: 0 1 auto;
  text-align: center;
  padding: 0.55rem 1.8rem;
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  border-radius: var(--radius-full);
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  color: var(--brand-dark);
  background: var(--brand-light);
}

.nav-item.active {
  color: #fff;
  background: var(--brand-dark);
  box-shadow: 0 2px 12px rgba(107, 45, 78, 0.25);
}

/* ===== Album Categories ===== */
.album-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 1.5rem 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.album-folder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.3rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--accent-light);
  border-radius: var(--radius-md);
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.album-folder:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-dark);
  background: var(--brand-light);
}

/* ===== Gallery Grid ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 5rem;
  padding: 0 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.gallery img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

/* Lazy Loading Placeholder */
.gallery img[data-src] {
  background: linear-gradient(135deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
}

/* Upload Tile */
.gallery .upload-tile {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  border: 2px dashed var(--accent-light);
  border-radius: var(--radius-sm);
  font-size: 2.5rem;
  color: var(--accent);
  background: transparent;
  transition: var(--transition);
  order: -1;
}

.gallery .upload-tile:hover {
  border-color: var(--brand-dark);
  color: var(--brand-dark);
  background: var(--brand-light);
  transform: scale(1.02);
}

/* ===== Games List ===== */
.games-list {
  max-width: 500px;
  margin: 1.5rem auto 6rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.game-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  color: var(--text);
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.93rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
  transition: var(--transition);
}

.game-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
  background: var(--brand-light);
}

.game-card .arrow {
  font-size: 1.3rem;
  color: var(--accent);
  transition: var(--transition);
}

.game-card:hover .arrow {
  transform: translateX(4px);
  color: var(--brand-dark);
}

/* ===== Task Detail ===== */
.task-detail {
  max-width: 500px;
  margin: 2rem auto 6rem;
  padding: 0 1.5rem;
  text-align: center;
}

.task-detail h2 {
  font-family: var(--font-display);
  margin-bottom: 1rem;
  color: var(--brand-dark);
  font-size: 1.5rem;
}

.task-detail p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
}

.upload-btn {
  padding: 0.85rem 2rem;
  background: var(--brand-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.upload-btn:hover {
  background: var(--brand-dark-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(107, 45, 78, 0.3);
}

/* ===== Lightbox ===== */
#lightbox,
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox.is-open,
.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  background: rgba(0,0,0,0.92);
}

#lightbox img {
  max-width: 90%;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

#close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: var(--transition);
}

#close:hover {
  background: rgba(255,255,255,0.2);
}

.hidden { display: none; }

/* ===== Video Section ===== */
.video-section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.video-section h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--brand-dark);
  margin-bottom: 1rem;
  text-align: center;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #000;
}

.video-container video,
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.video-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  background: var(--card-bg);
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.video-card video {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.video-card .video-info {
  padding: 0.75rem 1rem;
}

.video-card .video-info h4 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.video-card .video-info p {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ===== Guestbook ===== */
form#guestForm {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  margin: 2rem auto;
}

form#guestForm input,
form#guestForm textarea {
  padding: 0.85rem 1rem;
  border: 1px solid var(--accent-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
  background: var(--card-bg);
}

form#guestForm input:focus,
form#guestForm textarea:focus {
  outline: none;
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(107, 45, 78, 0.1);
}

form#guestForm button {
  padding: 0.85rem;
  background: var(--brand-dark);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

form#guestForm button:hover {
  background: var(--brand-dark-hover);
}

/* ===== Guestbook Book Layout ===== */
#guestbook {
  width: 360px;
  height: 500px;
  margin: 2rem auto;
  position: relative;
  perspective: 1000px;
}

.book-page {
  width: 100%;
  height: 100%;
  position: absolute;
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  transform-origin: left center;
  backface-visibility: hidden;
  display: none;
}

.book-page.active { display: block; }

.book-page.polaroid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  padding-top: 1.5rem;
  background: var(--primary-bg);
}

.book-page.polaroid img {
  max-width: 85%;
  border: 6px solid white;
  box-shadow: var(--shadow-sm);
  border-radius: 2px;
}

.book-page.polaroid h2 {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.book-page.polaroid p {
  font-style: italic;
  text-align: center;
  margin-top: 0.5rem;
  max-width: 90%;
  color: var(--text-light);
}

/* ===== Entry Form ===== */
#entry-form {
  background: var(--card-bg);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  width: 360px;
  margin: 1rem auto;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}

#entry-form input,
#entry-form textarea {
  width: 100%;
  margin: 0.4rem 0;
  padding: 0.65rem;
  font-size: 0.95rem;
  border: 1px solid var(--accent-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
}

#entry-form button {
  background: var(--brand-dark);
  color: white;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

#entry-form button:hover {
  background: var(--brand-dark-hover);
}

/* ===== Admin ===== */
#adminLogin {
  position: fixed;
  bottom: 70px;
  right: 1rem;
  background: var(--card-bg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  font-size: 0.85rem;
}

#adminLogin input {
  padding: 0.4rem;
  margin-right: 0.4rem;
  border: 1px solid var(--accent-light);
  border-radius: 4px;
}

/* ===== Dark Mode ===== */
.dark-mode {
  --primary-bg: #1a1a1a;
  --card-bg: #2a2a2a;
  --text: #e8e8e8;
  --text-light: #aaa;
  background-color: var(--primary-bg);
  color: var(--text);
}

.dark-mode .book-page {
  background-color: var(--card-bg) !important;
  color: var(--text) !important;
}

.dark-mode .navbar {
  background: rgba(26,26,26,0.95);
  border-top-color: rgba(255,255,255,0.05);
}

/* ===== Scroll Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h2 { font-size: 1.5rem; }
  .hero .portrait { width: 120px; height: 120px; }
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    padding: 0 1rem;
  }
  .gallery img { height: 150px; }
  .video-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 2rem 1rem 1.5rem; }
  .hero h2 { font-size: 1.3rem; }
  .hero .portrait { width: 100px; height: 100px; }
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .gallery img { height: 120px; }
  .nav-item { padding: 0.5rem 1.2rem; font-size: 0.85rem; }
  .game-card { padding: 0.9rem 1.1rem; font-size: 0.88rem; }
  .album-categories { gap: 0.75rem; margin: 1rem; }
  .album-folder { padding: 1rem; font-size: 0.9rem; }
}

/* ===== Print ===== */
@media print {
  .navbar, .topbar, #adminLogin { display: none !important; }
}
