/* ==========================================================================
   CABINA DE FOTOS RETRO & MARCO POLAROID
   Archivo Secreto · Módulo de Cámara Vintage
   ========================================================================== */

.retro-camera-section {
  position: relative;
  margin-top: 40px;
}

.retro-camera-card {
  padding: clamp(24px, 4vw, 48px);
  position: relative;
  overflow: hidden;
}

.retro-camera-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 36px;
}

.retro-camera-header p {
  color: #f6dce9;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-top: 10px;
}

/* Grid: Viewfinder on left, Polaroid on right */
.retro-camera-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
}

@media (max-width: 900px) {
  .retro-camera-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   LADO IZQUIERDO: VISOR DE CÁMARA
   -------------------------------------------------------------------------- */
.camera-viewfinder-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.camera-viewport-wrap {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  background: #0d0610;
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.25s ease;
}

/* Mirror for front-facing camera */
.camera-video.mirrored {
  transform: scaleX(-1);
}

/* Camera Standby / Permission screen */
.camera-standby-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(35, 15, 33, 0.94), rgba(12, 5, 14, 0.98));
  color: #f7dce9;
  z-index: 5;
  transition: opacity 0.3s ease;
}

.camera-standby-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.camera-standby-icon {
  font-size: 3.2rem;
  margin-bottom: 12px;
  animation: float 4s ease-in-out infinite;
}

.camera-standby-overlay h4 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-family: "Playfair Display", serif;
  color: #fff;
}

.camera-standby-overlay p {
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 280px;
  margin: 0 0 16px;
  color: #e5c3d7;
}

/* Viewfinder HUD overlays */
.camera-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.hud-live-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 5, 16, 0.7);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ff9bd0;
  border: 1px solid rgba(255, 155, 208, 0.3);
}

.hud-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3377;
  box-shadow: 0 0 8px #ff3377;
  animation: blink 1.2s infinite;
}

/* Viewfinder corners */
.viewfinder-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.corner-tl { top: 16px; left: 16px; border-right: none; border-bottom: none; }
.corner-tr { top: 16px; right: 16px; border-left: none; border-bottom: none; }
.corner-bl { bottom: 16px; left: 16px; border-right: none; border-top: none; }
.corner-br { bottom: 16px; right: 16px; border-left: none; border-top: none; }

.viewfinder-center-cross {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  opacity: 0.45;
}
.viewfinder-center-cross::before,
.viewfinder-center-cross::after {
  content: "";
  position: absolute;
  background: #fff;
}
.viewfinder-center-cross::before { top: 11px; left: 0; width: 24px; height: 2px; }
.viewfinder-center-cross::after { top: 0; left: 11px; width: 2px; height: 24px; }

/* Visual camera flash */
.camera-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.35s ease-out;
}
.camera-flash.flash-active {
  opacity: 1;
  transition: none;
}

/* Filters selector */
.camera-filters-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

.filters-label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #ffb8db;
  margin: 0;
  text-transform: uppercase;
}

.camera-filters-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 143, 199, 0.4) transparent;
}

.filter-chip {
  flex: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 184, 219, 0.6);
  transform: translateY(-2px);
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(255, 92, 168, 0.8), rgba(169, 76, 255, 0.8));
  border-color: #fff;
  box-shadow: 0 4px 18px rgba(255, 92, 168, 0.5);
  color: #fff;
}

/* Filter CSS rules for preview */
.filter-chispa-rosa {
  filter: sepia(0.22) saturate(1.3) hue-rotate(-12deg) contrast(1.06) brightness(1.02);
}
.filter-retro-90s {
  filter: sepia(0.42) contrast(1.18) brightness(0.94) saturate(1.22);
}
.filter-noir {
  filter: grayscale(1) contrast(1.28) brightness(0.96);
}
.filter-golden {
  filter: sepia(0.32) saturate(1.45) brightness(1.06) contrast(1.03);
}
.filter-pastel {
  filter: brightness(1.07) contrast(0.96) saturate(1.15) hue-rotate(5deg);
}
.filter-natural {
  filter: none;
}

/* Shutter & Switch buttons */
.camera-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

.shutter-btn {
  background: linear-gradient(135deg, #ffffff, #ffb5dc, #ff63ac);
  color: #351025;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 35px rgba(255, 99, 172, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  flex: 1;
  justify-content: center;
}

.shutter-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 45px rgba(255, 99, 172, 0.65);
}

.shutter-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.shutter-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.camera-action-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  transition: transform 0.2s, background 0.2s;
  flex: none;
}

.camera-action-icon-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.25);
}

/* --------------------------------------------------------------------------
   LADO DERECHO: MARCO POLAROID REVELADO
   -------------------------------------------------------------------------- */
.camera-result-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.polaroid-frame-card {
  position: relative;
  width: min(390px, 100%);
  background: #faf8f5;
  color: #281a24;
  border-radius: 14px;
  padding: 18px 18px 26px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 4px 14px rgba(255, 143, 199, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.9);
  transform: rotate(-1.5deg);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.polaroid-frame-card:hover {
  transform: rotate(0deg) scale(1.02);
}

/* Polaroid washi tape */
.polaroid-frame-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(1.5deg);
  width: 85px;
  height: 24px;
  background: rgba(255, 215, 235, 0.7);
  backdrop-filter: blur(4px);
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 6;
  border: 1px dashed rgba(255, 160, 205, 0.45);
}

/* Photo area */
.polaroid-photo-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #190f1b;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.polaroid-empty-state {
  text-align: center;
  padding: 24px;
  color: #e5c3d7;
}

.polaroid-empty-state span {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 10px;
  opacity: 0.85;
}

.polaroid-empty-state p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.polaroid-captured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.25s ease;
}

/* Polaroid bottom chin */
.polaroid-chin {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.polaroid-caption-input {
  width: 100%;
  background: transparent;
  border: 1px dashed transparent;
  border-radius: 6px;
  padding: 6px 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  color: #2b1825;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.polaroid-caption-input:hover,
.polaroid-caption-input:focus {
  border-color: rgba(255, 110, 180, 0.5);
  background: rgba(255, 240, 248, 0.5);
}

.polaroid-date-badge {
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #8c6a7e;
  text-transform: uppercase;
}

/* Actions under Polaroid */
.polaroid-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.download-polaroid-btn {
  background: linear-gradient(135deg, #fff, #ffb6dc);
  color: #351025;
  box-shadow: 0 8px 30px rgba(255, 91, 170, 0.35);
}

.download-polaroid-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 40px rgba(255, 91, 170, 0.55);
}

.download-polaroid-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hidden elements */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Status toast message */
.camera-status-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(25, 8, 26, 0.92);
  backdrop-filter: blur(14px);
  color: #fff;
  border: 1px solid rgba(255, 143, 199, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}

.camera-status-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Mobile Responsiveness (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .retro-camera-card {
    padding: 20px 14px !important;
    border-radius: 22px !important;
  }

  .retro-camera-header {
    margin-bottom: 24px !important;
  }

  .retro-camera-header h2 {
    font-size: 1.45rem !important;
  }

  .retro-camera-header p {
    font-size: 0.92rem !important;
  }

  .camera-viewport-wrap {
    max-width: 100% !important;
    border-radius: 18px !important;
  }

  .camera-filters-track {
    padding: 8px 2px !important;
    gap: 6px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .camera-filter-chip {
    padding: 6px 10px !important;
    font-size: 0.76rem !important;
  }

  .camera-controls-bar {
    gap: 10px !important;
    margin-top: 14px !important;
  }

  .camera-icon-btn {
    width: 42px !important;
    height: 42px !important;
  }

  .camera-shutter-btn {
    width: 62px !important;
    height: 62px !important;
  }

  .polaroid-frame-card {
    width: 100% !important;
    transform: none !important;
    padding: 14px 14px 22px !important;
    border-radius: 12px !important;
  }

  .polaroid-frame-tape {
    transform: translateX(-50%) rotate(0deg) !important;
  }

  .polaroid-caption-input {
    font-size: 1rem !important;
  }

  .polaroid-actions {
    flex-direction: column !important;
    width: 100% !important;
  }

  .polaroid-actions button {
    width: 100% !important;
  }
}
