:root {
  --color-salvia: #8A9A86;
  --color-salvia-dark: #6C7D68;
  --color-panna: #FDFBF7;
  --color-text: #2B3A33;
  --color-accent: #D8C3A5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--color-panna);
  color: var(--color-text);
  overflow-x: hidden;
}

/* Header Elegante con Logo */
.wedding-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 85px;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(138, 154, 134, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease;
}

body.camera-open .wedding-header {
  transform: translateY(-100%);
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0px;
}

.header-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.header-names {
  font-family: 'Great Vibes', 'Alex Brush', cursive !important;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--color-salvia);
  text-transform: none !important;
  line-height: 1;
}

/* Hero Carousel Wrapper */
.hero-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 10;
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.hero-container.slide-up {
  transform: translateY(-100dvh);
}

.swiper {
  width: 100%;
  height: 100%;
}

.swiper-slide {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: calc(5vw + env(safe-area-inset-bottom));
  background-size: cover;
  background-position: center;
  position: relative;
  box-sizing: border-box;
}

.swiper-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(43, 58, 51, 0.85) 0%, rgba(0, 0, 0, 0.15) 60%);
}

.slide-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #ffffff;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.slide-content h2 {
  font-size: 1.8rem;
  margin-bottom: 0px;
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: 0.5px;
  padding: 0 20px;
}

/* Testo Slide 1 */
.top-welcome-box {
  position: absolute;
  top: 100px;
  left: 0;
  width: 100%;
  z-index: 5;
  text-align: center;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-title {
  font-family: 'Great Vibes', 'Alex Brush', cursive !important;
  font-size: 2.2rem;
  font-weight: 400;
  color: #ffffff;
  white-space: nowrap;
  line-height: 1;
  margin-bottom: 2px !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.wedding-date {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 2px;
  color: #ffffff;
  text-transform: uppercase;
  margin-top: 0px !important;
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Bottoni Unificati */
.btn-wedding {
  position: relative;
  z-index: 5;
  display: block;
  width: 90vw;
  max-width: 420px;
  margin: 0 auto;
  padding: 16px 0;
  background-color: rgba(138, 154, 134, 0.75);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  box-sizing: border-box;
}

.btn-wedding:active {
  transform: scale(0.97);
  background-color: rgba(108, 125, 104, 0.9);
  color: #ffffff;
}

/* Sezioni a comparsa */
.content-section {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 110px 24px 40px 24px;
  display: none;
  background-color: var(--color-panna);
  box-sizing: border-box;
}

.content-section.active {
  display: block;
}

.btn-back {
  display: inline-block;
  background: rgba(138, 154, 134, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 24px;
  backdrop-filter: blur(4px);
}

/* Menù Placeholder */
.menu-card {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(138, 154, 134, 0.2);
  margin-top: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.menu-card h3 {
  color: var(--color-salvia-dark);
  margin-bottom: 8px;
  font-size: 1.2rem;
  border-bottom: 1px solid var(--color-salvia);
  padding-bottom: 4px;
}

.menu-card p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 15px;
}

/* Form e Guestbook */
.guest-form {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(138, 154, 134, 0.2);
  margin-bottom: 30px;
}

.guest-input, .guest-textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.95rem;
  margin-bottom: 12px;
  outline: none;
}

.guest-input:focus, .guest-textarea:focus {
  border-color: var(--color-salvia);
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.msg-bubble {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  border-left: 4px solid var(--color-salvia);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.msg-author {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.msg-time {
  font-weight: 400;
  font-size: 0.8rem;
  color: #888;
}

/* FOTOCAMERA NATIVA A SCHERMO INTERO */
.camera-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: #000;
  z-index: 200 !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateY(100dvh);
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.camera-section.active {
  transform: translateY(0);
}

.camera-header-native {
  position: absolute;
  top: calc(15px + env(safe-area-inset-top));
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 220;
  box-sizing: border-box;
}

.cam-top-right {
  display: flex;
  gap: 12px;
}

/* BOTTONI SUPERIORI: Stile Verde Salvia & Glassmorphism */
.btn-cam-icon {
  background: rgba(138, 154, 134, 0.75) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 22px;
  padding: 8px 16px;
  height: 42px;
  min-width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

/* Pulsante Chiudi (X) circolare */
.camera-header-native > .btn-cam-icon:first-child {
  width: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.1rem;
}

.btn-cam-icon:active {
  transform: scale(0.92);
  background: rgba(108, 125, 104, 0.9) !important;
}

/* Pulsante Flash in stato ON (Effetto Oro/Accent) */
#btnToggleFlash.flash-on {
  background: rgba(216, 195, 165, 0.9) !important;
  color: #2B3A33 !important;
  border-color: #ffffff !important;
}

.flash-overlay {
  position: fixed;
  inset: 0;
  background-color: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 210;
  transition: opacity 0.1s ease;
}

.flash-overlay.active {
  opacity: 0.98;
}

.camera-viewfinder {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
}

#webcamVideo, #previewImage, #previewVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-bottom-wrapper {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 220;
}

/* Grafica Selettore FOTO / VIDEO */
.mode-switch {
  display: flex;
  gap: 24px;
  background: rgba(138, 154, 134, 0.45);
  padding: 6px 20px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.mode-opt {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.mode-opt.active {
  color: #ffffff;
  border-bottom: 2px solid #ffffff;
}

.camera-controls {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.btn-shutter {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background-color: #fff;
  border: 5px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-shutter:active {
  transform: scale(0.9);
}

.btn-shutter.recording {
  background-color: #ff3b30 !important;
  border-color: #ffffff !important;
  animation: pulse-red 1.2s infinite alternate;
}

@keyframes pulse-red {
  from { transform: scale(0.9); }
  to { transform: scale(1.05); }
}

.btn-gallery-label {
  color: #fff;
  font-size: 0.85rem;
  background: rgba(138, 154, 134, 0.75);
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

/* BARRA DIDASCALIA STILE WHATSAPP */
.preview-caption-bar {
  position: absolute;
  bottom: calc(15px + env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 230;
  box-sizing: border-box;
}

.caption-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 8px 16px;
  backdrop-filter: blur(12px);
}

.caption-icon {
  color: #aaa;
  margin-right: 8px;
  font-size: 1rem;
}

.caption-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.95rem;
}

.caption-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.btn-send-whatsapp {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-salvia);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-send-whatsapp:active {
  transform: scale(0.9);
  background-color: var(--color-salvia-dark);
}

.upload-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background: rgba(43, 58, 51, 0.95);
  padding: 14px 28px;
  border-radius: 25px;
  display: none;
  z-index: 240;
  font-weight: 500;
  text-align: center;
}
