/* ============================================
   Hochzeits-App CSS – Martina & Sebastian
   Design: Deep Teal · Bokeh · Elegant
   ============================================ */

:root {
  --teal:        #2a7a7a;
  --teal-light:  #4aa8a8;
  --teal-dark:   #1a5555;
  --teal-deep:   #0d2f35;
  --teal-glow:   rgba(74,168,168,.35);
  --white:       #ffffff;
  --text-light:  rgba(255,255,255,.92);
  --text-muted:  rgba(255,255,255,.5);
  --glass:       rgba(13,47,53,.6);
  --glass-light: rgba(255,255,255,.07);
  --glass-border:rgba(255,255,255,.13);
  --shadow:      0 8px 32px rgba(13,47,53,.5);
  --radius:      16px;
  --tab-h:       72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Raleway', sans-serif;
  background: var(--teal-deep);
  color: var(--text-light);
  min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- SCREENS ---- */
.screen { position: fixed; inset: 0; overflow-y: auto; transition: opacity .5s, transform .5s; }
.screen:not(.active) { opacity: 0; pointer-events: none; transform: translateY(16px); }
.screen.active { opacity: 1; transform: none; }

/* ---- WELCOME ---- */
#screen-welcome {
  background: url('/assets/bg.jpg') center/cover no-repeat fixed;
}
#screen-welcome::before {
  content: '';
  position: fixed; inset: 0;
  background: rgba(8,30,36,.5);
}

.welcome-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100dvh;
  padding: 3rem 2rem 5rem;
  text-align: center;
}

/* MS Monogramm SVG */
.monogram {
  width: 120px; height: 120px;
  margin-bottom: 1.6rem;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(74,168,168,.7));
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.couple-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.8rem, 9vw, 4.8rem);
  font-weight: 300; font-style: italic;
  color: var(--white);
  line-height: 1.05; margin-bottom: .6rem;
  text-shadow: 0 2px 40px rgba(74,168,168,.6);
}

.wedding-date {
  font-family: 'Raleway', sans-serif;
  font-size: .78rem; font-weight: 400;
  letter-spacing: .38em; text-transform: uppercase;
  color: var(--teal-light); margin-bottom: 1.6rem;
  text-shadow: 0 0 20px rgba(74,168,168,.8);
}

.divider-ornament {
  color: rgba(74,168,168,.45);
  font-size: 1rem; letter-spacing: .4em; margin-bottom: 1.6rem;
}

.welcome-text {
  font-size: .95rem; font-weight: 300;
  color: var(--text-muted);
  line-height: 1.8; margin-bottom: 2.2rem;
}

.nickname-wrap { width: 100%; max-width: 300px; margin-bottom: 1.6rem; }

.nickname-input {
  width: 100%; padding: .9rem 1.3rem;
  border: 1px solid var(--glass-border); border-radius: 50px;
  background: rgba(13,47,53,.6);
  backdrop-filter: blur(16px);
  font-family: 'Raleway', sans-serif; font-size: .9rem; font-weight: 300;
  color: var(--white); text-align: center; outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.nickname-input:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(74,168,168,.2);
}
.nickname-input::placeholder { color: var(--text-muted); }

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: 1rem 2.2rem;
  background: linear-gradient(135deg, var(--teal-light) 0%, var(--teal-dark) 100%);
  color: #fff; border: none; border-radius: 50px;
  font-family: 'Raleway', sans-serif; font-size: .85rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(42,122,122,.5), 0 0 0 1px rgba(255,255,255,.1);
  transition: transform .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { transform: scale(.97); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.4rem;
  background: rgba(255,255,255,.07);
  color: var(--teal-light);
  border: 1px solid var(--glass-border); border-radius: 50px;
  font-family: 'Raleway', sans-serif; font-size: .85rem; font-weight: 400;
  cursor: pointer; backdrop-filter: blur(8px);
  transition: background .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:active { background: rgba(74,168,168,.15); }

.btn-ghost {
  background: none; border: none;
  color: var(--text-muted); font-family: 'Raleway', sans-serif;
  font-size: .85rem; cursor: pointer; padding: .75rem;
  text-decoration: underline;
  -webkit-tap-highlight-color: transparent;
}

/* ---- MAIN APP ---- */
#screen-app {
  background:
    radial-gradient(ellipse at 80% 10%, rgba(74,168,168,.1) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 90%, rgba(26,85,85,.15) 0%, transparent 50%),
    var(--teal-deep);
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom));
}

/* ---- TAB BAR ---- */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10,35,42,.88);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-around;
}

.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-family: 'Raleway', sans-serif;
  font-size: .62rem; font-weight: 400; letter-spacing: .1em; text-transform: uppercase;
  padding: .75rem 0; transition: color .2s;
  -webkit-tap-highlight-color: transparent;
}
.tab.active { color: var(--teal-light); }
.tab.active svg { filter: drop-shadow(0 0 5px var(--teal-glow)); }

.tab-upload-btn {
  flex: 0 0 72px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fab-inner {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, var(--teal-light) 0%, var(--teal-dark) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 4px 20px rgba(74,168,168,.5), 0 0 0 4px rgba(74,168,168,.1);
  transition: transform .2s;
}
.tab-upload-btn:active .fab-inner { transform: scale(.93); }

/* ---- TAB CONTENT ---- */
.tab-content { display: none; padding: 1rem 1rem 2rem; }
.tab-content.active { display: block; }

/* ---- GALLERY ---- */
.gallery-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 1.25rem 0 1rem;
}
.gallery-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem; font-weight: 300; font-style: italic;
  color: var(--white);
  text-shadow: 0 0 20px rgba(74,168,168,.4);
}
.gallery-count { font-size: .72rem; color: var(--text-muted); letter-spacing: .06em; }

.gallery-grid { columns: 2; column-gap: .6rem; }
@media (min-width: 480px) { .gallery-grid { columns: 3; } }
@media (min-width: 700px) { .gallery-grid { columns: 4; } }

.gallery-item {
  break-inside: avoid; margin-bottom: .6rem;
  border-radius: 12px; overflow: hidden; cursor: pointer;
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 16px rgba(13,47,53,.4);
  transition: transform .2s; animation: fadeIn .4s ease both;
}
.gallery-item:active { transform: scale(.97); }
.gallery-item img { width: 100%; display: block; object-fit: cover; }

.gallery-item .own-badge {
  position: absolute; top: 6px; right: 6px;
  background: rgba(74,168,168,.85);
  color: white; font-size: .58rem; font-weight: 500;
  padding: .15rem .45rem; border-radius: 20px;
  letter-spacing: .06em; text-transform: uppercase;
}
.gallery-item .own-badge--pending {
  background: rgba(180,120,40,.85);
}
.gallery-item .type-badge {
  position: absolute; top: 6px; left: 6px;
  background: rgba(13,47,53,.65);
  color: var(--teal-light); font-size: .8rem;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--glass-border);
}
.gallery-item .caption-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(13,47,53,.85));
  color: rgba(255,255,255,.8); font-size: .72rem; font-weight: 300;
  padding: 1.5rem .6rem .5rem;
  opacity: 0; transition: opacity .2s;
}
.gallery-item:hover .caption-overlay { opacity: 1; }

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

.gallery-loader, .btn-load-more, .gallery-empty {
  margin: 2rem auto; text-align: center; display: block;
}
.hidden { display: none !important; }

.spinner {
  width: 32px; height: 32px;
  border: 2px solid rgba(74,168,168,.2);
  border-top-color: var(--teal-light);
  border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-load-more {
  padding: .75rem 2rem;
  background: var(--glass-light); border: 1px solid var(--glass-border);
  border-radius: 50px; color: var(--teal-light);
  font-family: 'Raleway', sans-serif; font-size: .85rem;
  cursor: pointer; backdrop-filter: blur(8px);
}

.gallery-empty { color: var(--text-muted); }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }

/* ---- UPLOAD ---- */
.upload-area { max-width: 440px; margin: 0 auto; padding-top: 1.5rem; }

.drop-zone {
  border: 1.5px dashed rgba(74,168,168,.35);
  border-radius: var(--radius); padding: 2.5rem 1.5rem; text-align: center;
  background: var(--glass); backdrop-filter: blur(12px);
  transition: border-color .2s, background .2s;
}
.drop-zone.dragover { border-color: var(--teal-light); background: rgba(74,168,168,.07); }

.drop-icon { color: rgba(74,168,168,.35); margin-bottom: 1rem; }
.drop-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; font-style: italic; font-weight: 300;
  color: var(--white); margin-bottom: .4rem;
}
.drop-sub { font-size: .75rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.7; }
.upload-buttons { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.preview-area { margin-top: 1.5rem; }
.preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: .5rem; margin-bottom: 1.2rem;
}
.preview-thumb {
  aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--glass); position: relative; border: 1px solid var(--glass-border);
}
.preview-thumb img, .preview-thumb video { width: 100%; height: 100%; object-fit: cover; }
.preview-thumb .remove-btn {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; background: rgba(13,47,53,.75);
  color: white; border: none; border-radius: 50%; font-size: .7rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.caption-input {
  width: 100%; padding: .85rem 1.1rem;
  border: 1px solid var(--glass-border); border-radius: 10px;
  background: var(--glass); backdrop-filter: blur(8px);
  font-family: 'Raleway', sans-serif; font-size: .9rem; font-weight: 300;
  color: var(--white); outline: none; margin-bottom: 1.2rem;
  transition: border-color .2s;
}
.caption-input:focus { border-color: var(--teal-light); }
.caption-input::placeholder { color: var(--text-muted); }

.preview-area .btn-primary { width: 100%; justify-content: center; margin-bottom: .75rem; }
.preview-area .btn-ghost { width: 100%; text-align: center; }

.upload-progress { text-align: center; padding: 3rem 1rem; }
.progress-ring-wrap { position: relative; width: 80px; height: 80px; margin: 0 auto 1.2rem; }
.progress-ring { transform: rotate(-90deg); }
.progress-bg { fill: none; stroke: rgba(74,168,168,.15); stroke-width: 4; }
.progress-arc {
  fill: none; stroke: var(--teal-light); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 213.6; stroke-dashoffset: 213.6; transition: stroke-dashoffset .3s;
  filter: drop-shadow(0 0 6px var(--teal-glow));
}
.progress-ring-wrap span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 500; color: var(--teal-light);
}
#progress-label { color: var(--text-muted); font-size: .9rem; }

.upload-success { text-align: center; padding: 3rem 1rem; }
.success-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--teal-light) 0%, var(--teal-dark) 100%);
  color: white; font-size: 1.8rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.2rem;
  box-shadow: 0 0 30px rgba(74,168,168,.6);
  animation: popIn .4s cubic-bezier(.17,.67,.35,1.3);
}
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.upload-success h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem; font-style: italic; font-weight: 300;
  color: var(--white); margin-bottom: .5rem;
}
.upload-success p { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }
.upload-success .btn-primary { margin: 0 auto; }

/* ---- LIGHTBOX ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(6,22,26,.96); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  animation: lbIn .25s ease;
}
.lightbox.hidden { display: none; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

.lb-close {
  position: absolute; top: 1.2rem; right: 1.2rem;
  background: var(--glass-light); border: 1px solid var(--glass-border);
  color: white; width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.lb-content {
  max-width: min(90vw, 900px); max-height: 85dvh;
  display: flex; flex-direction: column; align-items: center;
}
.lb-media { max-width: 100%; max-height: 75dvh; object-fit: contain; border-radius: 8px; }
.lb-meta { margin-top: .75rem; text-align: center; padding: 0 2rem; }
.lb-meta p { color: rgba(255,255,255,.65); font-size: .85rem; }
#lb-author { color: var(--teal-light); font-size: .75rem; margin-top: .25rem; }

.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: var(--glass-light); border: 1px solid var(--glass-border);
  color: white; width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
