/* =========================================================
   RuangMomen.id Camera — Modern Festive Warmth Experience
   ========================================================= */

.camera-viewport-page {
  min-height: 100vh;
  background: linear-gradient(170deg, #fff8f6 0%, #f5ecea 100%);
  color: #1e1b1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  position: relative;
  overflow-x: hidden;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* White Blinding Screen Flash Layer */
.screen-flash {
  position: fixed;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  transition: opacity 0.08s ease-out;
}
.screen-flash.trigger {
  opacity: 0.95;
  transition: none;
}

/* Modern Camera Console Chassis */
.camera-console {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 32px;
  border: 1.5px solid #e1bfb6;
  box-shadow: 
    0 24px 50px -10px rgba(68, 42, 34, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.8);
  padding: 14px 14px;
  position: relative;
  user-select: none;
  box-sizing: border-box;
}

/* Room Event Banner Header */
.camera-brand-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #a9310a 0%, #cb4922 100%);
  padding: 10px 16px;
  border-radius: 18px;
  margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(169, 49, 10, 0.25);
}

.brand-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.25);
  color: #fffbff;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.model-badge .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5252;
  box-shadow: 0 0 8px #ff5252;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Viewfinder Frame — locked 3:4, never letterboxed */
.viewfinder-outer {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  background: #000000;
  border-radius: 22px;
  overflow: hidden;
  border: 3px solid #1e1b1a;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-video, #preview-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Fill the finder, cropping overflow like a real camera */
  display: block;
}

/* Fallback inside the finder when the camera cannot start */
.camera-fallback-panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: linear-gradient(160deg, #fff8f6 0%, #f5ecea 100%);
}

/* Minimal Viewfinder Reticle Overlay */
.viewfinder-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crosshair {
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  position: relative;
}

.crosshair::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  transform: translate(-50%, -50%);
}

.corner-brackets {
  position: absolute;
  inset: 14px;
}

.corner-brackets::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 16px; height: 16px;
  border-top: 2px solid rgba(255, 255, 255, 0.6);
  border-left: 2px solid rgba(255, 255, 255, 0.6);
  border-top-left-radius: 6px;
}

.corner-brackets::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 16px; height: 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.6);
  border-right: 2px solid rgba(255, 255, 255, 0.6);
  border-bottom-right-radius: 6px;
}

/* Camera Controls Bar */
.camera-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  background: #fbf2f0;
  border: 1px solid #efe6e4;
  padding: 5px 10px;
  border-radius: 18px;
}

/* Clean Photo Exposure Counter */
.lcd-counter-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lcd-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #59413b;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.lcd-screen {
  background: #ffffff;
  border: 1.5px solid #e1bfb6;
  border-radius: 10px;
  padding: 3px 10px;
  font-family: 'Space Grotesk', monospace;
  font-size: 16px;
  font-weight: 800;
  color: #a9310a;
}

/* Tactical Controls: Flash & Switch */
.flash-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid #e1bfb6;
  color: #59413b;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.flash-toggle-btn.active {
  background: #ffddb8;
  color: #653e00;
  border-color: #fea619;
}

.flash-toggle-btn:active {
  transform: scale(0.96);
}

/* Shutter & Action Bar */
.camera-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 6px 0 6px;
}

/* Auxiliary Icons (Gallery Pick / Gallery View) */
.aux-btn {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  background: #fbf2f0;
  border: 1.5px solid #efe6e4;
  color: #59413b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.aux-btn:hover {
  background: #efe6e4;
  color: #a9310a;
  transform: translateY(-1px);
}

.aux-btn:active {
  transform: scale(0.95);
}

/* Tactile Primary Shutter Button */
.shutter-btn-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shutter-ring {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #fbf2f0;
  border: 4px solid #ffdbd1;
  box-shadow: 0 8px 24px rgba(169, 49, 10, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shutter-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a9310a 0%, #cb4922 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(169, 49, 10, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: all 0.15s ease;
}

.shutter-btn:hover {
  transform: scale(1.02);
}

.shutter-btn:active {
  transform: scale(0.92);
  box-shadow: 0 2px 6px rgba(169, 49, 10, 0.3);
}

/* Modals (Name Gate & Review Modal) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(30, 27, 26, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  color: #1e1b1a;
  border-radius: 28px;
  border: 1px solid #e1bfb6;
  box-shadow: 0 24px 50px -10px rgba(68, 42, 34, 0.25);
  width: 100%;
  box-sizing: border-box;
}

/* Polaroid Card in Review Modal */
.polaroid-card {
  background: #ffffff;
  padding: 10px 10px 16px 10px;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 0 0 1px #efe6e4;
  text-align: center;
}

.polaroid-img-box {
  width: 100%;
  max-height: 52vh;
  border-radius: 12px;
  overflow: hidden;
  background: #1e1b1a;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.polaroid-img-box img {
  max-width: 100%;
  max-height: 52vh;
  object-fit: contain; /* Full uncropped preview */
  display: block;
}

.polaroid-caption {
  font-size: 13px;
  font-weight: 700;
  color: #1e1b1a;
  margin-top: 8px;
  letter-spacing: -0.2px;
}

.polaroid-sender {
  font-size: 11.5px;
  font-weight: 600;
  color: #8d7169;
  margin-top: 2px;
}

.polaroid-sender span {
  color: #a9310a;
  font-weight: 700;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: #1e1b1a;
  color: #ffffff;
  padding: 11px 20px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: toastPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes toastPop {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
