* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  background: linear-gradient(135deg, #a0ff74 0%, #6cb5a2 100%);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.container {
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 1100px;
  width: 100%;
  height: 90vh;
  max-height: 800px;
  display: grid;
  grid-template-columns: 1fr 380px;
  overflow: hidden;
}

.camera-section {
  padding: 30px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
}

.header {
  margin-bottom: 16px;
}

.header h1 {
  font-size: 28px;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.header p {
  color: #666;
  font-size: 14px;
}

.video-container {
    position: relative;
    width: 60vw;   /* responsive width */
    max-width: 400px; /* ensures it doesn't get too big */
    aspect-ratio: 3/4; /* approximate frame ratio */
    overflow: hidden;
    border-radius: 16px;
    margin: 0 auto 16px; /* centered with spacing below */
    background: #000;
  }
  
  /* Video inside container, mirrored and centered */
  #videoPreview {
    position: absolute;
    top: 50%;
    left: 50%;
    width: auto;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%) scaleX(-1); /* mirror & center */
  }
  

.countdown {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  font-size: 120px;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 30px rgba(255,255,255,0.5);
  animation: pulse 1s ease-in-out infinite;
}

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

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  min-width: 140px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #a0ff74 0%, #6cb5a2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-secondary:hover:not(:disabled) {
  background: #f8f9fa;
}

.sidebar {
  padding: 30px;
  background: white;
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.preview-container {
  flex: 1;
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  position: relative;
}

#finalImage {
  max-width: 100%;
  max-height: 100%;
  display: none;
  border-radius: 12px;
}

.preview-placeholder {
  text-align: center;
  color: #999;
  padding: 40px;
}

.frame-selector {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.frame-option {
  aspect-ratio: 3/4;
  border: 3px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  position: relative;
}

.frame-option:hover {
  border-color: #667eea;
  transform: translateY(-2px);
}

.frame-option.active {
  border-color: #667eea;
  box-shadow: 0 0 0 2px #667eea;
}

.frame-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.gender-pill {
  position: relative;
  display: flex;
  width: 200px;
  background: #eee;
  border-radius: 30px;
  overflow: hidden;
}

.gender-pill input {
  display: none;
}

.gender-pill .slider {
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.gender-pill {
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.15);
}

.gender-pill label {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  user-select: none;
}

.gender-pill .slider {
  position: absolute;
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, #a0ff74 0%, #6cb5a2 100%);
  border-radius: 30px;
  z-index: 1;
  transition: transform 0.3s;
}

input#gender-female:checked ~ .slider {
  transform: translateX(100%);
}

.status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  display: none;
}

.status.success {
  background: #d4edda;
  color: #155724;
  display: block;
}

.status.error {
  background: #f8d7da;
  color: #721c24;
  display: block;
}

.status.info {
  background: #d1ecf1;
  color: #0c5460;
  display: block;
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    height: 95vh;
  }
  
  .sidebar {
    border-left: none;
    border-top: 1px solid #e0e0e0;
  }
}

.canvas { display: none; }
.live-preview {display: none;}


