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

/* === Body — kutu dışı kalan alan === */
body {
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: 'Georgia', 'Times New Roman', serif;
}

/* === Sahne kapsayıcısı — flex item olarak viewport genişliğini fill et,
   böylece içerideki .invitation-wrapper'ın aspect-ratio kutusu 0×0
   collapse olmaz (tüm child'ları absolute olduğu için intrinsic
   genişliğe katkıları sıfır → parent'a width verilmezse 0). === */
#invitation-stage {
  width: 100%;
}

/* === Aspect-ratio kutusu (oran inline style ile gelir) === */
.invitation-wrapper {
  position: relative;
  width: 100%;
  margin: auto 0;
}

/* === Arka plan görseli === */
.invitation-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 0;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.invitation-wrapper picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* === Bileşen konumlandırma === */
.component {
  position: absolute;
  z-index: 10;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

/* === Görünmez tıklanabilir alanlar (yükleme, konum) === */
.component--upload-area {
  opacity: 0;
  cursor: pointer;
}
.component--map-area {
  opacity: 0;
  cursor: pointer;
  display: block;
}

/* === Geri sayım === */
.component--countdown {
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.countdown-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.countdown-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3rem;
}

.countdown-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.countdown-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  margin-top: 0.25rem;
}

@media (min-width: 768px) {
  .countdown-inner { gap: 1.5rem; }
  .countdown-value { font-size: 2.5rem; }
  .countdown-label { font-size: 0.85rem; }
}

/* === Butonlar === */
.inv-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 2rem;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  /* Faz 8: wrapper .component--rsvp-btn varsayılan beyaz atar; kullanıcı stil
     panelinden renk değiştirirse buton yazısı onu kalıtır. */
  color: inherit;
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Wrapper varsayılan metin rengi — stil paneli override etmediği sürece beyaz kalır. */
.component--rsvp-btn { color: #fff; }

.inv-btn:hover,
.inv-btn:focus-visible {
  background: rgba(0, 0, 0, 0.55);
  border-color: #c9a84c;
  outline: none;
}

.inv-btn:active {
  transform: scale(0.97);
}

@media (min-width: 768px) {
  .inv-btn {
    padding: 0.85rem 2rem;
    font-size: 1rem;
  }
}

/* === Buton ikonları === */
.inv-btn-icon {
  display: inline-block;
  vertical-align: -0.15em;
  margin-right: 0.35em;
  flex-shrink: 0;
}

/* === RSVP Inline Form (sahnede area olarak konumlanır) ===
   .component sınıfı translate(-50%,-50%) uygular; w/h yüzdelik.
   Koyu çerçeve yok; içerik invitation-rsvp.js ile --rsvp-fit scale ile kutuya sığar. */
.component--rsvp-area {
  overflow: hidden;
}

.rsvp-fit-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rsvp-fit-content {
  width: 360px;
  flex: 0 0 auto;
  transform: scale(var(--rsvp-fit, 1));
  transform-origin: center center;
}

/* Özel form HTML'i de aynı sayaç/harita gibi sabit tasarım genişliğinde
   render edilir; sahnedeki kutuya `transform: scale(--rsvp-fit)` ile orantılı
   olarak küçülür. Default 360px dar bir 2-sütunlu form için yetersiz olduğundan
   custom modda 800px tasarım genişliği veriyoruz — kullanıcının
   `max-width: 820px` gibi tipik form kabukları doğal halinde sığar.
   Fluid layout denenmiyor: dar alanlarda grid kolonların kelime kelime
   kırılıp dikey strip'e dönmesi yerine bütün form oransal küçülür. */
.rsvp-fit-content--custom {
  width: 800px;
}

/* === RSVP Varsayılan Form === */
.rsvp-title {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.35rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #c9a84c;
  letter-spacing: 0.03em;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rsvp-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rsvp-field label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(240, 235, 225, 0.7);
}

.rsvp-optional {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
  opacity: 0.6;
}

.rsvp-field input,
.rsvp-field select,
.rsvp-field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  color: #f0ebe1;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}

.rsvp-field input::placeholder,
.rsvp-field textarea::placeholder {
  color: rgba(240, 235, 225, 0.35);
}

.rsvp-field input:focus,
.rsvp-field select:focus,
.rsvp-field textarea:focus {
  border-color: #c9a84c;
}

.rsvp-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c9a84c' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.rsvp-field select option {
  background: #1a1a1a;
  color: #f0ebe1;
}

.rsvp-field textarea {
  resize: vertical;
  min-height: 4rem;
}

.rsvp-submit {
  margin-top: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #c9a84c;
  border: none;
  border-radius: 2rem;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.25s, transform 0.15s;
}

.rsvp-submit:hover {
  background: #dabb65;
}

.rsvp-submit:active {
  transform: scale(0.97);
}

/* === RSVP Sonuç Ekranı === */
.rsvp-result {
  text-align: center;
  padding: 2rem 0;
}

.rsvp-result[hidden] {
  display: none;
}

.rsvp-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.15);
  color: #c9a84c;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.rsvp-result-text {
  font-size: 1rem;
  color: rgba(240, 235, 225, 0.85);
}

/* === Müzik toggle butonu (Faz 6A) === */
.component--music-toggle {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
  z-index: 20;
}
.component--music-toggle:hover,
.component--music-toggle:focus-visible {
  background: rgba(0, 0, 0, 0.65);
  border-color: #c9a84c;
  outline: none;
}
.component--music-toggle .music-icon {
  display: block;
  pointer-events: none;
}

/* === Animasyon videosu (Faz 6B) === */
.component--animation {
  overflow: hidden;
  pointer-events: none;
}
.animation-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  background: transparent;
}

/* === Kapak sayfası (Faz 6C, §10a) === */
.cover-stage {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity var(--cover-fade, 700ms) ease;
}
.cover-stage--fading {
  opacity: 0;
  pointer-events: none;
}
.cover-stage:focus-visible {
  outline: 3px solid #c9a84c;
  outline-offset: -3px;
}
.cover-picture {
  position: absolute;
  inset: 0;
  display: block;
}
.cover-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.cover-hint {
  position: absolute;
  bottom: 8vh;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1.25rem;
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2rem;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: coverHintPulse 1.8s ease-in-out infinite;
  z-index: 2;
}
.cover-stage--playing .cover-hint {
  opacity: 0;
  transition: opacity 0.3s;
}
@keyframes coverHintPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* === Upload toast bildirimi === */
.upload-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 0.65rem 1.25rem;
  border-radius: 2rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: #f0ebe1;
  background: rgba(26, 26, 26, 0.92);
  border: 1px solid rgba(201, 168, 76, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  pointer-events: none;
}
.upload-toast[hidden] {
  display: none;
}
.upload-toast--success {
  border-color: rgba(76, 175, 80, 0.5);
}
.upload-toast--error {
  border-color: rgba(244, 67, 54, 0.5);
}

/* === Galeri (Faz 10 / P3-3) === */
.component--gallery-btn {
  position: absolute;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  z-index: 30;
}
.component--gallery-btn .inv-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  background: rgba(26, 26, 26, 0.7);
  border: 1px solid rgba(201, 168, 76, 0.5);
  border-radius: 2rem;
  color: inherit;
  font-family: inherit;
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.component--gallery-btn:hover .inv-btn {
  border-color: rgba(201, 168, 76, 0.9);
}

.gallery-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.gallery-overlay[hidden] { display: none; }
.gallery-modal {
  background: #1a1a1a;
  color: #f0ebe1;
  width: min(1100px, 96vw);
  height: min(900px, 90vh);
  border-radius: 12px;
  border: 1px solid rgba(201, 168, 76, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gallery-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.gallery-modal__header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: #c9a84c;
}
.gallery-close {
  background: transparent;
  border: 0;
  color: #f0ebe1;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.5rem;
}
.gallery-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
.gallery-status {
  text-align: center;
  padding: 2rem;
  color: rgba(240, 235, 225, 0.6);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}
.gallery-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: #0f0f0f;
  cursor: pointer;
  overflow: hidden;
  border-radius: 4px;
}
.gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.gallery-cell:hover img {
  transform: scale(1.05);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.gallery-lightbox[hidden] { display: none; }
.gallery-lightbox__img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
}
.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  background: rgba(26, 26, 26, 0.7);
  border: 1px solid rgba(201, 168, 76, 0.4);
  color: #f0ebe1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-lightbox__close { top: 1rem; right: 1rem; }
.gallery-lightbox__nav--prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.gallery-lightbox__nav--next { right: 1rem; top: 50%; transform: translateY(-50%); }
.gallery-lightbox__counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(240, 235, 225, 0.7);
  font-size: 0.85rem;
  background: rgba(26, 26, 26, 0.7);
  padding: 0.3rem 0.75rem;
  border-radius: 1rem;
}

body.gallery-open { overflow: hidden; }

/* === Hava Durumu (Faz 10 / P3-4) === */
.component--weather {
  position: absolute;
  pointer-events: none;
  z-index: 25;
}
.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: rgba(26, 26, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.5rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #f0ebe1;
  font-family: inherit;
  font-size: 0.85rem;
}
.weather-chip img {
  width: 28px;
  height: 28px;
  display: block;
}
.weather-chip .weather-temp {
  font-weight: 500;
  font-size: 1.05rem;
}
.weather-chip .weather-desc {
  opacity: 0.85;
  font-size: 0.75rem;
  text-transform: capitalize;
}
.weather-chip[hidden] { display: none; }
