html, body {
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
  background-color: #f0f8ff;
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  background-color: #e0f0ff;
}

.camera-container {
  position: relative;
  flex: 1;
  overflow: hidden;
  background-color: #000;
  aspect-ratio: 3/4;
  margin: 0 auto;
  max-height: calc(100% - 130px);
}

#video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#video.user-facing {
  transform: scaleX(-1);
}

.frame-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.frame-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.capture-border {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 15;
}

.controls {
  background-color: transparent;
  padding: 8px;
  display: flex;
  justify-content: space-around;
  position: relative;
  z-index: 20;
}

.frame-btn {
  background-color: #0099ff;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  margin: 0 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.capture-area {
  background-color: transparent;
  height: 70px;
  position: relative;
  z-index: 20;
}

.capture-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background-color: #0099ff;
  border: 4px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.camera-switch {
  position: absolute;
  left: calc(50% + 60px);
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: #0099ff;
  border: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.camera-switch svg {
  width: 20px;
  height: 20px;
}

.ui-container {
  position: relative;
  z-index: 20;
}

#canvas {
  display: none;
}

#photo-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  z-index: 100;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  padding: 20px;
  box-sizing: border-box;
}

#photo-overlay img {
  max-width: 90%;
  max-height: 70%;
  object-fit: contain;
  margin-bottom: 20px;
}

.photo-overlay-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.photo-btn {
  background-color: #0099ff;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
}

.photo-instruction {
  margin-bottom: 20px;
  font-size: 14px;
  max-width: 300px;
}

@media (max-aspect-ratio: 3/4) {
  .camera-container {
    width: 100%;
  }
}

@media (min-aspect-ratio: 3/4) {
  .camera-container {
    height: calc(100% - 130px);
    width: auto;
  }
}