@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Outfit:wght@400;700&display=swap');

:root {
  --bg-color: #0b0f19;
  --glass-bg: rgba(20, 25, 40, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --primary: #00f0ff;
  --secondary: #7000ff;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --gradient-main: linear-gradient(135deg, var(--primary), var(--secondary));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(112, 0, 255, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 240, 255, 0.15), transparent 25%);
  background-attachment: fixed;
}

/* Typography */
h1, h2, h3 {
  font-family: 'Outfit', sans-serif;
}

.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.3));
}

/* Glassmorphism Utilities */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

/* Navigation */
header {
  width: 100%;
  padding: 1.5rem 0;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 100;
}

.nav-container {
  display: flex;
  gap: 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* Main Layout */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.page-title {
  font-size: 3.5rem;
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
}

/* Sections */
.hero-content {
  max-width: 800px;
  text-align: center;
  animation: fadeUp 0.8s ease-out forwards;
}

.hero-content p {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-top: 1.5rem;
}

.hero-content b {
  color: var(--text-main);
  font-weight: 600;
  font-size: 1.4rem;
  display: block;
  margin-bottom: 1rem;
}

/* Buttons */
.btn-primary {
  background: var(--gradient-main);
  color: #fff;
  border: none;
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(112, 0, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 25px rgba(0, 240, 255, 0.5);
}

.btn-primary:hover::after {
  opacity: 1;
}

/* Camera and Video UI */
.workspace-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 2rem;
}

.instructions-panel {
  max-width: 800px;
  width: 100%;
  border-left: 4px solid var(--primary);
}

.instructions-panel h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.instructions-panel ol {
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.instructions-panel li {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* The actual WebCam / Video wrappers */
.webcam-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
  border: 1px solid var(--glass-border);
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 4/3;
}

.webcam-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.webcam-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

/* Image Upload specific styling */
.upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 800px;
}

.custom-file-upload {
  display: inline-block;
  padding: 1rem 2rem;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 2px dashed var(--glass-border);
  border-radius: 12px;
  color: var(--primary);
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  text-align: center;
}

.custom-file-upload:hover {
  border-color: var(--primary);
  background: rgba(0, 240, 255, 0.05);
}

input[type="file"] {
  display: none;
}

.preview-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  overflow: hidden;
  min-height: 200px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-border);
}

.preview-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

.preview-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  pointer-events: none;
}

.action-bar {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animated-pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; text-shadow: 0 0 20px rgba(0, 240, 255, 0.6); }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(10px);
  margin-top: auto;
}

footer p {
  margin-bottom: 0.5rem;
}

footer .credits {
  color: var(--primary);
  font-weight: 500;
}

/* Hide legacy elements seamlessly */
.hidden {
  display: none !important;
}
