.camera-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.camera-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.camera-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex: 1;
}

.camera-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: var(--header-height, 56px);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  z-index: 10;
}

.camera-header::after {
  content: '';
  width: 44px;
  height: 44px;
}

.camera-header h3 {
  color: white;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.close-camera-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  touch-action: manipulation;
}

.close-camera-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.25);
}

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

.camera-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.capture-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: white;
  border: 4px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
  padding: 0;
}

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

.capture-btn-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: white;
  border: 2px solid #333;
}

.camera-preview {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.camera-preview img {
  max-width: 100%;
  max-height: 70%;
  object-fit: contain;
}

.preview-controls {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  padding: 20px;
}

.preview-controls button {
  padding: 12px 30px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.1s;
}

.preview-controls button:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-primary {
  background: #10b981;
  color: white;
}

/* Button loading state */
.btn-loading {
  opacity: 0.7;
  cursor: not-allowed;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.preview-controls button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.camera-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}

.camera-loading p {
  margin-top: 20px;
  font-size: 16px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

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

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .camera-header h3 {
    font-size: 16px;
  }

  .capture-btn {
    width: 70px;
    height: 70px;
  }

  .capture-btn-inner {
    width: 56px;
    height: 56px;
  }

  .preview-controls button {
    padding: 10px 20px;
    font-size: 14px;
  }
}
