:host {
  display: block;
  width: 100%;
  height: 100%;
}

.face-detector-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #000;
}

/* Loading indicator */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 5;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.video-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.video-stream.mirrored {
  transform: scaleX(-1);
}

/* Hide native video controls on Safari/WebKit */
.video-stream::-webkit-media-controls {
  display: none !important;
}

.video-stream::-webkit-media-controls-panel {
  display: none !important;
}

.video-stream::-webkit-media-controls-play-button {
  display: none !important;
}

.video-stream::-webkit-media-controls-start-playback-button {
  display: none !important;
}

.video-stream::-webkit-media-controls-enclosure {
  display: none !important;
}

.detection-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 65;
}

.detection-overlay.mirrored {
  transform: scaleX(-1);
}

.error-message {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  width: fit-content;
  color: #ff4444;
  z-index: 10;
}


.face-info {
  position: absolute;
  top: 50px;
  left: 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  width: fit-content;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  z-index: 100;
  min-width: 130px;
}


.rotation-info {
  font-size: 12px;
  font-weight: 500;
}

.axis-info {
  margin: 2px 0;
  font-family: monospace;
  white-space: nowrap;
  width: 100%;
}

.copy-metrics-button {
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.copy-metrics-button:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.copy-metrics-button:active {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(0);
}

.countdown-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

.countdown-svg-number {
  font-family: Arial, sans-serif;
  font-size: 120px;
  font-weight: bold;
  fill: white;
}

.countdown-svg-text {
  font-size: 14px;
  font-weight: normal;
  fill: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
}


.capture-flash-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  pointer-events: none;
  z-index: 20;
  animation: flash 0.3s ease-out;
}

@keyframes flash {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}

.instructions-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 80;
  pointer-events: auto;
  animation: fadeIn 0.5s ease-out;
  box-sizing: border-box;
  overflow: hidden;
  padding: 40px 20px 30px 20px;
  gap: 15px;
}

.instructions-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
}

.instruction-icon {
  display: block;
  text-align: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.instruction-icon img {
  max-width: 90px;
  max-height: 90px;
  width: auto;
  height: auto;
}

.accessories-icons {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.accessories-icons img {
  max-width: 70px;
  max-height: 70px;
  width: auto;
  height: auto;
}

.accessory-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.9;
}

.prohibition-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.instruction-title {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: white;
  text-align: center;
  margin: 0 0 15px 0;
  padding: 0 15px;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.instruction-text {
  display: block;
  font-size: 16px;
  color: white;
  margin: 0;
  padding: 0 20px;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.3px;
  text-align: center;
  line-height: 1.4;
  flex-shrink: 0;
}

.instruction-subtext {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin: 12px 0 0 0;
  padding: 0 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  text-align: center;
  flex-shrink: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}


.progress-bar-container {
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.progress-segments {
  display: flex;
  gap: 10px;
  height: 5px;
  width: 100%;
}

.progress-segment {
  flex: 1;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-segment.active {
  background-color: rgba(255, 255, 255, 0.3);
}

.segment-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: white;
  border-radius: 3px;
  transition: width 0.05s linear;
}

.instruction-buttons {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding-bottom: 10px;
}

.skip-button, .pause-button {
  padding: 14px 28px;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 15px;
  font-weight: 500;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  min-width: 100px;
  justify-content: center;
}

.skip-button:hover, .pause-button:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.skip-button:active, .pause-button:active {
  background-color: rgba(255, 255, 255, 0.35);
  transform: scale(0.97);
}


.help-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.help-button svg {
  opacity: 0.9;
}

.camera-button {
  position: absolute;
  top: 76px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.camera-button svg {
  opacity: 0.9;
}

.camera-menu {
  position: absolute;
  top: 76px;
  right: 76px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 10px;
  width: fit-content;
  min-width: 160px;
  z-index: 105;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.camera-menu-header {
  padding: 6px 12px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2px;
}

.camera-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 12px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 12px;
  text-align: left;
}

.camera-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.camera-menu-item.active {
  background-color: rgba(255, 255, 255, 0.15);
}

.camera-menu-item .camera-name {
  flex: 1;
  margin-right: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-menu-item svg {
  flex-shrink: 0;
  color: #5cb85c;
}

.status-indicator {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  width: fit-content;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  z-index: 100;
}

.face-error-message {
  position: absolute;
  top: 80%;
  left: 50%;
  transform: translate(-50%, -10%);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  width: fit-content;
  max-width: 85%;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  z-index: 20;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Manual capture mode styles */
.manual-position-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
  animation: fadeIn 0.5s ease-out;
  display: flex;
  flex-direction: column;
}

/* SVG-based oval styles for Safari/iPad compatibility */
.oval-area-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 120px);
  pointer-events: none;
  z-index: 50;
}

/* SVG oval recording animation */
.svg-oval-recording {
  stroke: #28a745;
  filter: drop-shadow(0 0 8px rgba(40, 167, 69, 0.6))
          drop-shadow(0 0 16px rgba(40, 167, 69, 0.3));
  animation: svg-oval-recording-glow 2s ease-in-out infinite;
}

@keyframes svg-oval-recording-glow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(40, 167, 69, 0.6))
            drop-shadow(0 0 16px rgba(40, 167, 69, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(40, 167, 69, 0.8))
            drop-shadow(0 0 24px rgba(40, 167, 69, 0.4));
  }
}

/* Oval area - takes most of the height */
.oval-area {
  flex: 1;
  height: calc(100% - 120px);
  position: relative;
  /* Add dark overlay for the entire oval area */
  background: rgba(0, 0, 0, 0.55);
  /* Use mask to create oval cutout - inner radius minus 8px so border is 8px larger than cutout */
  -webkit-mask-image: radial-gradient(
    ellipse
    calc(var(--oval-radius-x, 120px) - 8px)
    calc(var(--oval-radius-y, 160px) - 8px)
    at 50% 50%,
    transparent 100%,
    black 100%
  );
  mask-image: radial-gradient(
    ellipse
    calc(var(--oval-radius-x, 120px) - 8px)
    calc(var(--oval-radius-y, 160px) - 8px)
    at 50% 50%,
    transparent 100%,
    black 100%
  );
}

/* Bottom control area - fixed 120px height */
.bottom-control-area {
  height: 120px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px 20px 20px;
  box-sizing: border-box;
  pointer-events: auto;
  gap: 15px;
  /* Dark background for bottom area */
  background: rgba(0, 0, 0, 0.55);
}

.bottom-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 600px;
  gap: 15px;
}

.bottom-instructions {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bottom-instructions .instruction-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bottom-instructions .instruction-text {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.bottom-button-container {
  display: flex;
  justify-content: center;
}

.bottom-record-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 140px;
}

.bottom-record-button:hover {
  background: #fff;
  transform: translateY(-2px);
}

.bottom-record-button .record-button-text {
  color: #333;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

/* Allow button clicks inside the overlay */
.manual-position-overlay .manual-capture-button-container {
  pointer-events: auto;
}

/* CSS-based oval implementation */
/* This container represents the actual rendered video area (excluding letterbox/pillarbox) */
.css-oval-container {
  position: absolute;
  /* Position and size centered in the entire oval-area */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 60;
}

/* Transparent cutout for the oval (removes dark overlay in oval shape) */
.oval-background-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* This creates a "hole" in the parent's dark background */
  /* The parent (.oval-area) has the dark background, this cuts out the oval */
  background: transparent;
  /* Inverse mask: transparent where the oval is, black everywhere else */
  /* This makes the oval area see-through to the video below */
  mix-blend-mode: normal;
  pointer-events: none;
}

/* CSS oval border - perfectly uniform and dynamically positioned */
.css-oval-border {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Width and height set dynamically based on video dimensions */
  width: var(--oval-width, 240px);
  height: var(--oval-height, 320px);
  /* Border width is responsive */
  border: var(--oval-border-width, 6px) solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
  box-sizing: border-box;
  transition: all 0.3s ease;
  z-index: 70;
}

/* Recording state for CSS oval */
.css-oval-border.recording {
  border-color: #28a745;
  filter: drop-shadow(0 0 8px rgba(40, 167, 69, 0.6)) 
          drop-shadow(0 0 16px rgba(40, 167, 69, 0.3));
  animation: css-oval-recording-glow 2s ease-in-out infinite;
}

@keyframes css-oval-recording-glow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(40, 167, 69, 0.6)) 
            drop-shadow(0 0 16px rgba(40, 167, 69, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(40, 167, 69, 0.8)) 
            drop-shadow(0 0 24px rgba(40, 167, 69, 0.4));
  }
}

.square-border-normal {
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

.square-border-recording {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(40, 167, 69, 0.6)) 
          drop-shadow(0 0 16px rgba(40, 167, 69, 0.3));
  animation: recording-glow 2s ease-in-out infinite;
}

/* Óvalo completamente estático - sin sombras, sin cambios de color */

/* Contenedor del modo manual */
.manual-mode-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Legacy manual button styles - kept for compatibility */

/* Legacy instruction styles - kept for compatibility */

/* Contador regresivo dentro del óvalo */
.oval-countdown-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.countdown-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(255, 167, 38, 0.9);
  padding: 16px 20px;
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.countdown-number {
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  animation: countdown-pulse 0.8s ease-in-out infinite;
}

.countdown-text {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Indicador de grabación en el centro del óvalo */
.recording-indicator-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.record-indicator-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.record-indicator-circle {
  width: 14px;
  height: 14px;
  background-color: #ff4444;
  border-radius: 50%;
  position: relative;
  animation: record-indicator-enhanced-pulse 1.8s ease-in-out infinite;
}

.record-indicator-circle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 2px solid #ff4444;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: record-indicator-ring 1.8s ease-out infinite;
}

.record-indicator-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  animation: record-indicator-text-enhanced 1.8s ease-in-out infinite;
}


@keyframes recording-glow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(40, 167, 69, 0.6)) 
            drop-shadow(0 0 16px rgba(40, 167, 69, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(40, 167, 69, 0.8)) 
            drop-shadow(0 0 24px rgba(40, 167, 69, 0.4));
  }
}

.oval-loader {
  animation: dash-move 3s linear infinite;
  transform-origin: center;
}

@keyframes dash-move {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -400;
  }
}

.oval-instructions {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 65%;
  min-width: 180px;
  text-align: center;
  z-index: 45;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.instruction-icon-small {
  width: 24px;
  height: 24px;
  color: #ffffff;
  opacity: 0.9;
}

.manual-instruction-text {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  word-wrap: break-word;
  hyphens: auto;
}

/* Botón REC debajo del óvalo cuando se está grabando */
.oval-button-center {
  position: absolute;
  bottom: 20px; /* Same level as manual record button for consistency */
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
}

.oval-capture-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 65px;
  height: 65px;
  padding: 0;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.oval-capture-button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  border-color: #ff4444;
}

.oval-capture-button:active {
  transform: scale(0.95);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.record-button-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.record-button-circle {
  width: 16px;
  height: 16px;
  background-color: #ff4444;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 68, 68, 0.5);
  animation: record-button-pulse 2s ease-in-out infinite;
}

.record-button-text {
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-family: 'Arial', monospace;
  letter-spacing: 0.4px;
}

/* Contador regresivo dentro del botón */
.countdown-display {
  width: 16px;
  height: 16px;
  background-color: #ff4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(255, 68, 68, 0.5);
  animation: countdown-pulse 1s ease-in-out infinite;
}

.countdown-number {
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  font-family: 'Arial', monospace;
}

.oval-capture-button:hover .record-button-circle {
  animation: record-button-pulse-fast 1s ease-in-out infinite;
}

.oval-capture-button:hover .record-button-text {
  color: #ff4444;
}

/* Manual recording animation */
.manual-recording-animation {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 20px;
  padding: 8px 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.recording-pulse-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rec-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background-color: #ff4444;
  border-radius: 50%;
  animation: rec-pulse 1s ease-in-out infinite;
}

.rec-text {
  color: #ff4444;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Arial', monospace;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  animation: rec-text-pulse 1s ease-in-out infinite;
}

.recording-border-pulse {
  animation: recording-border-pulse 2s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(255, 68, 68, 0);
  }
}

@keyframes rec-text-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes recording-border-pulse {
  0%, 100% {
    opacity: 0.8;
    stroke-width: 2;
  }
  50% {
    opacity: 0.4;
    stroke-width: 3;
  }
}

@keyframes record-button-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
  }
  50% {
    opacity: 0.8;
    transform: scale(0.95);
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.8);
  }
}

@keyframes record-button-pulse-fast {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.8);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.9);
    box-shadow: 0 0 16px rgba(255, 68, 68, 1);
  }
}

@keyframes countdown-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.8);
  }
}

@keyframes record-indicator-enhanced-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: 0 0 8px 2px rgba(255, 68, 68, 0.3);
  }
}

@keyframes record-indicator-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0.3;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

@keyframes record-indicator-text-enhanced {
  0%, 100% {
    opacity: 0.95;
    transform: translateY(0);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-1px);
  }
}

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


/* Responsive design for small screens */
@media (max-width: 768px) {
  /* Adjust bottom control area for mobile */
  .bottom-control-area {
    height: 110px; /* Slightly reduced for mobile */
    padding: 15px;
    gap: 12px;
  }

  .bottom-content {
    gap: 12px;
  }

  .bottom-instructions .instruction-text {
    font-size: 11px;
  }

  .bottom-record-button {
    padding: 8px 16px;
    min-width: 120px;
  }

  .bottom-record-button .record-button-text {
    font-size: 12px;
  }

  /* Adjust oval for smaller area */
  .oval-area {
    height: calc(100% - 110px);
  }

  /* Adjust SVG oval for smaller area */
  .oval-area-svg {
    height: calc(100% - 110px);
  }

  /* Adjust oval instructions positioning */
  .oval-instructions {
    bottom: 16px;
    max-width: 75%;
    min-width: 160px;
  }

  /* Instructions overlay responsive adjustments */
  .instructions-overlay {
    padding: 15px;
    gap: 15px;
  }

  .progress-bar-container {
    max-width: 250px;
  }

  .instruction-title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .instruction-text {
    font-size: 13px;
    line-height: 1.3;
  }

  .instruction-subtext {
    font-size: 11px;
    margin-top: 6px;
  }

  .instruction-buttons {
    gap: 8px;
  }

  .skip-button, .pause-button {
    padding: 10px 18px;
    font-size: 12px;
    border-radius: 18px;
  }

  .instruction-icon {
    margin-bottom: 10px;
  }

  .instruction-icon img {
    max-width: 70px;
    max-height: 70px;
  }

  .accessories-icons {
    gap: 12px;
  }

  .accessories-icons img {
    max-width: 55px;
    max-height: 55px;
  }
}

@media (max-height: 600px) {
  /* Adjust for short screens */
  .bottom-control-area {
    height: 90px; /* Compact for short screens */
    padding: 10px;
    gap: 8px;
  }

  .bottom-content {
    gap: 8px;
  }

  .bottom-instructions .instruction-content {
    padding: 6px 10px;
  }

  .bottom-instructions .instruction-text {
    font-size: 10px;
  }

  .bottom-record-button {
    padding: 6px 12px;
    min-width: 100px;
  }

  .bottom-record-button .record-button-text {
    font-size: 11px;
  }

  .oval-area {
    height: calc(100% - 90px);
  }

  /* Adjust SVG oval for short screens */
  .oval-area-svg {
    height: calc(100% - 90px);
  }

  /* Instructions overlay for short screens - distribute to extremes */
  .instructions-overlay {
    justify-content: space-between;
    padding: 15px;
    gap: 10px;
  }

  .progress-bar-container {
    max-width: 200px;
  }

  .instruction-title {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .instruction-text {
    font-size: 12px;
    line-height: 1.25;
  }

  .instruction-subtext {
    font-size: 10px;
    margin-top: 4px;
  }

  .instruction-buttons {
    gap: 8px;
  }

  .skip-button, .pause-button {
    padding: 8px 14px;
    font-size: 11px;
    border-radius: 14px;
  }

  .instruction-icon {
    margin-bottom: 8px;
  }

  .instruction-icon img {
    max-width: 50px;
    max-height: 50px;
  }

  .accessories-icons {
    gap: 8px;
  }

  .accessories-icons img {
    max-width: 40px;
    max-height: 40px;
  }

  /* Manual mode responsive adjustments */
  .css-oval-container {
    width: 100%;
    height: 100%;
  }

  .manual-instruction-text {
    font-size: 12px;
    line-height: 1.3;
  }

  .manual-recording-animation {
    top: 15px;
    right: 15px;
    padding: 6px 10px;
    border-radius: 16px;
  }

  .recording-pulse-indicator {
    gap: 8px;
  }

  .rec-text {
    font-size: 10px;
  }

  .rec-dot {
    width: 6px;
    height: 6px;
  }

  .oval-capture-button {
    width: 55px;
    height: 55px;
    border-width: 2px;
  }

  .record-button-content {
    gap: 3px;
  }

  .record-button-circle {
    width: 14px;
    height: 14px;
  }

  .record-button-text {
    font-size: 8px;
  }

  .countdown-display {
    width: 14px;
    height: 14px;
  }

  .countdown-number {
    font-size: 8px;
  }


  .manual-record-button {
    padding: 8px 16px;
    min-width: 120px;
    border-radius: 5px;
  }

  .manual-record-button .record-button-text {
    font-size: 12px;
    font-weight: 600;
  }

  .manual-record-button.countdown-button .record-button-text {
    font-size: 14px;
    font-weight: 700;
  }

  .record-indicator-circle {
    width: 12px;
    height: 12px;
  }

  .record-indicator-text {
    font-size: 11px;
  }


  .instruction-content {
    padding: 6px 10px;
    border-radius: 5px;
  }

  .instruction-main {
    font-size: 11px;
  }

  .instruction-sub {
    font-size: 12px;
  }

  /* Contador regresivo - responsive */
  .countdown-content {
    padding: 12px 16px;
    border-radius: 12px;
  }

  .countdown-number {
    font-size: 36px;
  }

  .countdown-text {
    font-size: 12px;
  }

}

/* Additional responsive breakpoints for better element spacing */
@media (max-width: 480px) {
  /* Legacy small screen rules - cleaned up */

  .oval-instructions {
    max-width: 80%;
    min-width: 140px;
  }
}

/* Very small height screens - distribute to extremes */
@media (max-height: 500px) {
  .instructions-overlay {
    justify-content: space-between;
    padding: 12px;
    gap: 8px;
  }

  .progress-bar-container {
    max-width: 180px;
  }

  .instruction-title {
    font-size: 14px;
    margin-bottom: 5px;
  }

  .instruction-text {
    font-size: 11px;
    line-height: 1.2;
  }

  .instruction-subtext {
    font-size: 9px;
    margin-top: 3px;
  }

  .instruction-icon {
    margin-bottom: 5px;
  }

  .instruction-icon img {
    max-width: 40px;
    max-height: 40px;
  }

  .accessories-icons {
    gap: 5px;
  }

  .accessories-icons img {
    max-width: 30px;
    max-height: 30px;
  }

  .instruction-buttons {
    gap: 6px;
  }

  .skip-button, .pause-button {
    padding: 6px 12px;
    font-size: 10px;
    border-radius: 12px;
  }
}

@media (max-width: 768px) and (max-height: 500px) {
  /* Landscape mobile - extra compact */
  .bottom-control-area {
    height: 80px; /* Compact for landscape */
    padding: 8px;
    gap: 6px;
  }

  .bottom-content {
    gap: 6px;
  }

  .bottom-instructions .instruction-content {
    padding: 4px 8px;
  }

  .bottom-instructions .instruction-text {
    font-size: 9px;
    line-height: 1.1;
  }

  .bottom-record-button {
    padding: 4px 10px;
    min-width: 90px;
  }

  .bottom-record-button .record-button-text {
    font-size: 10px;
  }

  .oval-area {
    height: calc(100% - 80px);
  }

  /* Adjust SVG oval for landscape */
  .oval-area-svg {
    height: calc(100% - 80px);
  }

  /* Instructions overlay for landscape mobile */
  .instructions-overlay {
    justify-content: space-between;
    padding: 10px;
    gap: 5px;
  }

  .progress-bar-container {
    max-width: 150px;
  }

  .instruction-title {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .instruction-text {
    font-size: 10px;
    line-height: 1.15;
  }

  .instruction-subtext {
    font-size: 8px;
    margin-top: 2px;
  }

  .instruction-icon {
    margin-bottom: 4px;
  }

  .instruction-icon img {
    max-width: 35px;
    max-height: 35px;
  }

  .accessories-icons {
    gap: 4px;
  }

  .accessories-icons img {
    max-width: 25px;
    max-height: 25px;
  }

  .instruction-buttons {
    gap: 5px;
  }

  .skip-button, .pause-button {
    padding: 5px 10px;
    font-size: 9px;
    border-radius: 10px;
  }
}

/* License error container styles - Simple Design */
.license-error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  height: 100%;
  width: 100%;
  background: #f5f7fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
}

.license-error-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  max-width: 480px;
  width: 100%;
  padding: 48px 32px;
  text-align: center;
}

.license-error-icon {
  color: #dc3545;
  margin-bottom: 24px;
}

.license-error-title {
  color: #2c3e50;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.license-error-message {
  color: #495057;
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.license-error-help {
  color: #6c757d;
  font-size: 14px;
  margin: 0 0 32px 0;
}

.license-error-help a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.license-error-help a:hover {
  text-decoration: underline;
}

.license-error-footer {
  color: #adb5bd;
  font-size: 12px;
  font-weight: 500;
  padding-top: 24px;
  border-top: 1px solid #e9ecef;
}

/* Responsive */
@media (max-width: 640px) {
  .license-error-card {
    padding: 32px 24px;
  }

  .license-error-title {
    font-size: 20px;
  }

  .license-error-message {
    font-size: 14px;
  }
}

.watermark {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 15;
  pointer-events: none;
  opacity: 0.7;
}

.watermark img {
  height: 24px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}