:host {
  display: block;
  width: 100%;
  height: 100%;
  font-family: system-ui, -apple-system, sans-serif;
  color: #1a1a1a;
}

.detector-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
}

h1 {
  font-size: 24px;
  font-weight: 500;
  color: #333;
  margin: 0 0 24px 0;
}

.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #000;
  border: none;
  border-radius: 8px;
  overflow: hidden;
}

video, .detection-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

video.mirror, .detection-overlay.mirror {
  transform: rotateY(180deg);
}

.detection-overlay {
  z-index: 1;
  pointer-events: none;
}

video {
  z-index: 0;
}

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

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

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

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

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

/* Detection boxes for debug mode */
.detection-box {
  transition: opacity 0.2s ease;
}


.status {
  margin-top: 16px;
  font-size: 12px;
  color: #666;
}

/* Overlay mask for ID card guidance */
.overlay-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: block;
  pointer-events: none;
}

.card-outline {
  position: absolute;
  top: var(--mask-center-y, 50%);
  left: var(--mask-center-x, 50%);
  transform: translate(-50%, -50%);
  width: var(--mask-width, 88%);
  height: var(--mask-height, 55%);
  border: none;
  border-radius: 4px;
  background: transparent;
  opacity: 0.8;
}

.card-outline.perfect-match {
}

/* Lados individuales de la máscara */
.side {
  position: absolute;
  background: #999;
  transition: background-color 0.3s ease;
  border-radius: 1px;
}

.side-top.aligned {
  border-left-color: #28a745;
  border-top-color: #28a745;
}

.side-right.aligned {
  border-right-color: #28a745;
  border-top-color: #28a745;
}

.side-bottom.aligned {
  border-left-color: #28a745;
  border-bottom-color: #28a745;
}

.side-left.aligned {
  border-right-color: #28a745;
  border-bottom-color: #28a745;
}

.side-top {
  top: -3px;
  left: -3px;
  width: 30px;
  height: 30px;
  border-left: 6px solid #ffffff;
  border-top: 6px solid #ffffff;
  background: transparent;
}

.side-right {
  top: -3px;
  right: -3px;
  width: 30px;
  height: 30px;
  border-right: 6px solid #ffffff;
  border-top: 6px solid #ffffff;
  background: transparent;
}

.side-bottom {
  bottom: -3px;
  left: -3px;
  width: 30px;
  height: 30px;
  border-left: 6px solid #ffffff;
  border-bottom: 6px solid #ffffff;
  background: transparent;
}

.side-left {
  bottom: -3px;
  right: -3px;
  width: 30px;
  height: 30px;
  border-right: 6px solid #ffffff;
  border-bottom: 6px solid #ffffff;
  background: transparent;
}







.guide-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  white-space: normal;
  padding: 13px;
  max-width: 300px;
  z-index: 20;
  height: fit-content;
  width: fit-content;
  animation: slideInFromTopCentered 0.3s ease-out;
}

/* Quality indicator */
.quality-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 12px;
  border-radius: 20px;
  z-index: 25;
  transition: all 0.3s ease;
}

.quality-indicator.warning {
  background: rgba(255, 152, 0, 0.9);
}

.quality-indicator.good {
  background: rgba(76, 175, 80, 0.9);
}

.quality-score {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

.quality-status {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  transition: all 0.3s ease;
}

.quality-status.ready {
  background: #4CAF50;
}

.quality-status.not-ready {
  background: #f44336;
}

/* Enhanced card outline for quality warnings */
.card-outline.quality-warning {
  animation: qualityWarning 1s ease-in-out infinite alternate;
}

@keyframes qualityWarning {
  0% {
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.6);
  }
  100% {
    box-shadow: 0 0 0 6px rgba(255, 152, 0, 0.3);
  }
}


/* Animación de captura */
.capture-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  opacity: 0;
  z-index: 30;
  pointer-events: none;
  animation: captureFlash 0.6s ease-out;
}

@keyframes captureFlash {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 0.8;
  }
  30% {
    opacity: 0;
  }
  45% {
    opacity: 0.4;
  }
  60% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* Animación del marco durante captura */
.card-outline.capturing {
  animation: pulseGreen 0.6s ease-out;
}

@keyframes pulseGreen {
  0% {
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0);
  }
  50% {
    border-color: #28a745;
    box-shadow: 0 0 0 8px rgba(40, 167, 69, 0.6);
  }
  100% {
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0);
  }
}

/* Animación de voltear identificación */
.flip-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 35;
  pointer-events: none;
  opacity: 0;
  animation: showFlipInstruction 3s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.id-card-icon {
  width: 80px;
  height: 50px;
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  border-radius: 8px;
  position: relative;
  animation: flipCard 2s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.id-card-icon::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 16px;
  height: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
}

.id-card-icon::after {
  content: '';
  position: absolute;
  top: 25px;
  left: 8px;
  width: 64px;
  height: 3px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 1px;
  box-shadow: 0 6px 0 rgba(255, 255, 255, 0.7), 0 12px 0 rgba(255, 255, 255, 0.7);
}

.flip-text {
  margin-top: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  background: rgba(128, 128, 128, 0.8);
  padding: 12px 20px;
  border-radius: 20px;
  max-width: 300px;
}

@keyframes showFlipInstruction {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

@keyframes flipCard {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(180deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}

/* Animación de éxito */
.success-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 35;
  pointer-events: none;
  opacity: 0;
  animation: showSuccessMessage 3s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.check-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  border-radius: 50%;
  position: relative;
  animation: bounceSuccess 0.6s ease-out;
  box-shadow: 0 4px 16px rgba(108, 117, 125, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-icon::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 35px;
  border: 4px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  /* animation: drawCheck 0.4s ease-out 0.2s both; */ /* Deshabilitado - check aparece completo */
}

.success-text {
  margin-top: 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  background: rgba(128, 128, 128, 0.8);
  padding: 12px 20px;
  border-radius: 20px;
  max-width: 300px;
  animation: fadeInUp 0.5s ease-out 0.4s both;
}

@keyframes showSuccessMessage {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

@keyframes bounceSuccess {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes drawCheck {
  0% {
    width: 0;
    height: 0;
  }
  50% {
    width: 20px;
    height: 0;
  }
  100% {
    width: 20px;
    height: 35px;
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sección para saltar reverso */
.skip-section {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 300px;
}

/* Sección unificada para captura del reverso */
.back-capture-section {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
}


.back-capture-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.capture-button {
  pointer-events: auto;
  background: #fff;
  color: #333;
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.capture-button:hover {
  background: #f8f9fa;
}

.capture-button:active {
  background: #e9ecef;
  transform: translateY(1px);
}

.capture-button:disabled,
.capture-button.primary-button:disabled {
  cursor: not-allowed !important;
  transform: none !important;
  opacity: 0.7 !important;
  transition: none !important;
}

/* Responsive para móviles */
@media (max-width: 480px) {
  .back-capture-section {
    bottom: 16px;
    max-width: 300px;
  }
  
  
  .back-capture-buttons {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  
  .capture-button,
  .back-capture-buttons .skip-button {
    width: 100%;
    max-width: 200px;
    padding: 10px 20px;
    font-size: 13px;
  }

  /* Ensure disabled styles work on mobile too */
  .capture-button:disabled,
  .capture-button.primary-button:disabled,
  .skip-button:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
  }
}

.skip-explanation {
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Performance warning animation for guide-text */
.guide-text.performance-warning-text {
  animation: gentlePulse 2s ease-in-out infinite;
  background: rgba(255, 107, 107, 0.3);
  border: 1px solid rgba(255, 107, 107, 0.5);
}

@keyframes gentlePulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    background: rgba(255, 107, 107, 0.3);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.02);
    background: rgba(255, 107, 107, 0.4);
  }
}


/* Botón para saltar reverso */
.skip-button {
  pointer-events: auto;
  background: #fff;
  color: #333;
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.skip-button:hover {
  background: #f8f9fa;
}

.skip-button:active {
  background: #e9ecef;
  transform: translateY(1px);
}

.skip-button:disabled {
  cursor: not-allowed !important;
  transform: none !important;
  opacity: 0.7 !important;
  transition: none !important;
}

/* Camera controls */
.camera-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 25;
  display: flex;
  gap: 8px;
  pointer-events: auto;
  animation: slideInFromTop 0.3s ease-out;
}


.camera-selector-button {
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  min-width: fit-content;
}

.camera-selector-button:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.camera-selector-button:active {
  transform: translateY(0);
  background: rgba(0, 0, 0, 0.9);
}

.camera-selector-button:disabled,
.camera-selector-button.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.camera-selector-button:disabled:hover,
.camera-selector-button.loading:hover {
  transform: none;
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top: 2px solid #333333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Camera selector dropdown */
.camera-selector-dropdown {
  position: absolute;
  top: 56px;
  right: 16px;
  z-index: 30;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  min-width: 260px;
  max-width: 300px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  pointer-events: auto;
  animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Animación específica para elementos centrados */
@keyframes slideInFromTopCentered {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-8px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0) scale(1);
  }
}

.camera-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-selector-header span {
  font-weight: 500;
  color: #ffffff;
  font-size: 13px;
  opacity: 0.9;
}

.close-selector {
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-selector:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.camera-list {
  padding: 4px 0;
  max-height: 240px;
  overflow-y: auto;
}

.camera-option {
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
}

.camera-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.camera-option.selected {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.camera-label {
  font-size: 13px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 0;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
}

.camera-label .autofocus-icon {
  font-size: 12px;
  color: #ffffff !important;
  opacity: 0.8;
  flex-shrink: 0;
}

.selected-indicator {
  font-size: 14px;
  color: #ffffff;
  opacity: 0.9;
  flex-shrink: 0;
}

.device-info {
  padding: 6px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.device-info small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  text-transform: capitalize;
  font-weight: 400;
}

/* Responsive design for camera controls */
@media (max-width: 480px) {
  .camera-controls {
    top: 12px;
    right: 12px;
    gap: 6px;
  }

  .camera-selector-button {
    height: 36px;
    padding: 0 12px;
    font-size: 11px;
    border-radius: 6px;
  }

  .camera-selector-dropdown {
    right: 12px;
    top: 48px;
    min-width: 240px;
    max-width: calc(100vw - 24px);
  }

  .camera-selector-header {
    padding: 6px 10px;
  }

  .camera-option {
    padding: 6px 10px;
  }

  .device-info {
    padding: 4px 10px;
  }
}

/* Marca de agua */
.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));
}

/* Estado siempre visible del componente */
.component-status {
  position: absolute;
  top: 16px;
  left: 16px;
  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;
  z-index: 40;
  height: 32px;
  width: fit-content;
  animation: slideInFromTop 0.3s ease-out;
}


.status-spinner {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-top: 1px solid #ffffff;
  border-radius: 50%;
  animation: statusSpin 1s linear infinite;
  flex-shrink: 0;
}

.status-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.status-message {
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  margin: 0;
}

.status-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  line-height: 1.2;
  margin: 0;
}

@keyframes statusSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive para estado en móviles */
@media (max-width: 480px) {
  .component-status {
    top: 12px;
    left: 12px;
    padding: 4px 8px;
    gap: 4px;
    height: 28px;
    border-radius: 8px;
  }

  .status-spinner {
    width: 14px;
    height: 14px;
  }

  .status-message {
    font-size: 11px;
  }

  .status-description {
    font-size: 9px;
  }
  
  .guide-text {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 8px;
  }
}

/* Animación de carga mejorada */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30;
  border-radius: 8px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top: 3px solid #28a745;
  border-radius: 50%;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 16px;
}

.loading-text {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  opacity: 0.9;
  margin-bottom: 4px;
}

.loading-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-align: center;
  opacity: 0.8;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Monitor de Performance - Diseño compacto y minimalista */
.performance-monitor {
  position: absolute;
  top: 70px;
  left: 16px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 35;
  width: fit-content;
  animation: slideInFromTop 0.3s ease-out;
  transition: all 0.3s ease;
}

@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}


.performance-expanded {
  padding: 6px 10px;
}

.metrics-row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.metrics-row:last-child {
  margin-bottom: 0;
}

.metric-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 50px;
}

.metric-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.metric-value {
  font-size: 10px;
  font-weight: 600;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  padding: 2px 4px;
  border-radius: 3px;
  text-align: center;
  white-space: nowrap;
}

.metric-value.good {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.metric-value.warning {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.metric-value.danger {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* Responsive para monitor de performance */
@media (max-width: 480px) {
  .performance-monitor {
    top: 60px;
    left: 12px;
    width: fit-content;
  }

  .performance-expanded {
    padding: 4px 8px;
  }

  .metrics-row {
    gap: 6px;
    margin-bottom: 3px;
  }

  .metric-compact {
    min-width: 45px;
    gap: 1px;
  }

  .metric-label {
    font-size: 8px;
  }

  .metric-value {
    font-size: 9px;
    padding: 1px 3px;
  }
}

/* Quality Monitor */
.quality-monitor {
  position: absolute;
  top: 200px;
  left: 16px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 35;
  width: fit-content;
  animation: slideInFromLeft 0.3s ease-out;
  transition: all 0.3s ease;
}

.quality-text {
  padding: 6px 10px;
  font-size: 11px;
  color: white;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  line-height: 1.4;
}

.quality-fail {
  color: #ff9999;
}

/* Animación pulsante para valores críticos */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.metric-value.danger {
  animation: pulse 2s infinite;
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .quality-monitor {
    top: 160px;
    left: 12px;
  }

  .quality-text {
    padding: 4px 8px;
    font-size: 10px;
  }
}

/* Sección de captura manual */
.manual-capture-section {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 300px;
}


.manual-capture-button {
  pointer-events: auto;
  background: #fff;
  color: #333;
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.manual-capture-button:hover {
  background: #f8f9fa;
}

.manual-capture-button:active {
  background: #e9ecef;
  transform: translateY(1px);
}

.manual-capture-button:disabled {
  cursor: not-allowed !important;
  transform: none !important;
  opacity: 0.7 !important;
  transition: none !important;
}

/* Responsive para móviles */
@media (max-width: 480px) {
  .manual-capture-section {
    bottom: 16px;
    max-width: 280px;
  }


  .manual-capture-button {
    padding: 10px 20px;
    font-size: 13px;
  }

  /* Ensure disabled styles work on mobile too */
  .manual-capture-button:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
  }
}

/* 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;
}

.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;
  }
}
