/**
 * Video Capture Styles
 * Adapted from alpha/4 for the landing page flow
 */

/* =============================================================================
   Video Recording View - Fullscreen Camera
   ============================================================================= */

.video-recording-view {
  position: fixed;
  top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--navy-blue);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 80px; /* Space for overlay */
}

.video-recording-view video {
  width: min(85vw, calc(100vh - var(--header-height) - 280px));
  height: min(85vw, calc(100vh - var(--header-height) - 280px));
  max-width: 400px;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* =============================================================================
   Recording Overlay - Status & Timer
   ============================================================================= */

.recording-overlay {
  position: fixed;
  top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  padding: 12px 20px;
  background: rgba(0,0,0,0.6);
  z-index: 501;
}

.recording-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-weight: 600;
  font-size: 18px;
}

.rec-dot {
  width: 12px;
  height: 12px;
  background: #ff0000;
  border-radius: 50%;
  animation: pulse-rec 1.5s ease-in-out infinite;
}

@keyframes pulse-rec {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.1); }
}

.timer {
  font-family: 'Courier New', monospace;
  font-size: 20px;
}

.guidance-text {
  margin-top: 15px;
  color: white;
  background: rgba(0,0,0,0.5);
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
}

/* =============================================================================
   Video Controls
   ============================================================================= */

.video-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  z-index: 501;
  padding: 0 20px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.control-btn {
  background: rgba(255,255,255,0.9);
  border: none;
  padding: 16px 28px;
  border-radius: 28px;
  font-size: 17px;
  font-weight: 600;
  color: var(--navy-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.2s;
  min-height: 56px;
  width: 90vw;
  max-width: 500px;
}

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

.control-btn.stop-btn {
  background: var(--red-grade);
  color: white;
}

.control-btn.record-btn {
  background: var(--red-grade);
  color: white;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(214, 59, 59, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(214, 59, 59, 0.8);
  }
}

/* =============================================================================
   Recording Guidance Overlay
   ============================================================================= */

.recording-guidance-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 502;
}

/* Framing Guide */
.framing-guide {
  position: fixed;
  top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 80px);
  left: 50%;
  transform: translateX(-50%);
  width: min(60vw, 300px);
  height: min(60vw, 300px);
  z-index: 503;
}

.framing-box {
  position: relative;
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(113, 185, 86, 0.6);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Corner markers */
.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(113, 185, 86, 0.9);
}

.corner.top-left {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 8px;
}

.corner.top-right {
  top: -2px;
  right: -2px;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 8px;
}

.corner.bottom-left {
  bottom: -2px;
  left: -2px;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 8px;
}

.corner.bottom-right {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 8px;
}

.framing-center-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.framing-secondary-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

/* Distance Marker */
.distance-marker {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(230, 114, 52, 0.9);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  z-index: 503;
}

.distance-marker i {
  font-size: 16px;
}

/* Feature Checklist */
.feature-checklist {
  position: absolute;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding: 12px;
  border-radius: 12px;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  z-index: 503;
}

.checklist-title {
  color: white;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 8px;
  font-size: 13px;
  transition: all 0.2s;
}

.checklist-item i {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.checklist-item.checked {
  color: var(--green-grade);
}

.checklist-item.checked i {
  color: var(--green-grade);
}

/* =============================================================================
   Recording Tips
   ============================================================================= */

.recording-tips {
  position: absolute;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 500px;
  pointer-events: auto;
}

.tip-content {
  background: rgba(33, 150, 243, 0.9);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  animation: tipSlideIn 0.5s ease-out;
}

.tip-content i {
  font-size: 16px;
  animation: tipPulse 2s ease-in-out infinite;
}

@keyframes tipSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tipPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* =============================================================================
   Orientation Warning
   ============================================================================= */

.orientation-warning {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  z-index: 503;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  text-align: center;
}

/* =============================================================================
   Camera Permission State
   ============================================================================= */

.camera-permission-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: white;
}

.camera-permission-prompt i {
  font-size: 64px;
  margin-bottom: 20px;
  color: var(--papyrus-gold);
}

.camera-permission-prompt h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.camera-permission-prompt p {
  font-size: 16px;
  opacity: 0.8;
  max-width: 300px;
  margin-bottom: 24px;
}

.camera-permission-prompt button {
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.enable-camera-btn {
  background: var(--red-grade);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.enable-camera-btn i {
  font-size: 18px;
}

/* =============================================================================
   Video Review Container
   ============================================================================= */

.video-review-container {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.video-review-container h2 {
  color: white;
  margin-bottom: 20px;
  text-align: center;
}

.video-player-wrapper {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.video-player-wrapper video {
  width: 100%;
  display: block;
}

.video-stats {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.video-stats p {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: white;
}

.video-stats i {
  color: var(--papyrus-gold);
  width: 20px;
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.action-buttons button {
  flex: 1;
  padding: 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.action-buttons .btn-retry {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.action-buttons .btn-use {
  background: var(--green-grade);
  color: white;
}

/* =============================================================================
   Mobile Optimizations
   ============================================================================= */

@media (max-width: 768px) {
  .framing-guide {
    width: 80%;
  }

  .framing-center-text {
    font-size: 14px;
    padding: 6px 12px;
  }

  .framing-secondary-text {
    font-size: 11px;
    padding: 4px 10px;
  }

  .control-btn {
    padding: 12px 20px;
    font-size: 14px;
    min-width: 100px;
  }

  .tip-content {
    font-size: 12px;
    padding: 10px 16px;
  }

  .action-buttons {
    flex-direction: column;
  }
}

/* =============================================================================
   Reduced Motion Support
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  .rec-dot,
  .control-btn.record-btn,
  .tip-content i {
    animation: none;
  }

  .tip-content {
    animation: none;
  }
}
