/* Camera Component Styles */

.camera-container {
  position: relative;
  overflow: hidden;
}

.camera-video {
  transform: scaleX(-1); /* Mirror front camera for natural selfie experience */
}

.camera-video.back-camera {
  transform: none; /* Don't mirror back camera */
}

.camera-capture-btn {
  position: relative;
  transition: transform 0.2s ease;
}

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


.camera-flip-btn {
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.camera-flip-btn:active {
  transform: scale(0.9);
  background-color: rgba(255, 255, 255, 0.3);
}

.camera-result-actions {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.1), transparent);
}

/* Loading state for camera initialization */
.camera-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: white;
}

.camera-loading::after {
  content: '📷 カメラを起動中...';
  font-size: 1.2rem;
}

/* Error state */
.camera-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  color: white;
  text-align: center;
  padding: 2rem;
}

.camera-error::before {
  content: '⚠️';
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .camera-capture-btn {
    width: 70px;
    height: 70px;
  }

  .camera-flip-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* Animation for view transitions */
.camera-view-transition {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.camera-view-transition.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* Fixed bottom action bar (design: width 390, height 112, top ~650; dark background) */
.camera-action-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  padding: 24px;
  background: #000;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Result view bottom action bar */
.camera-result-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Result overlay should sit above preview but below action bar */
.camera-result-overlay {
  position: absolute;
  z-index: 1;
}

.camera-result-buttons {
  width: 100%;
  max-width: 360px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.camera-result-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 64px;
  border-radius: 10px;
}

.camera-result-btn--secondary {
  background: #EEF2F7;
  color: #0F172A;
}

.camera-result-btn--primary {
  background: var(--rohto-light-blue);
  color: #fff;
}

.camera-result-btn__jp {
  font-weight: 700;
}

.camera-result-btn__en {
  font-size: 12px;
  opacity: 0.9;
}
