* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: radial-gradient(
    circle at top,
    #0f2740,
    #050b12
  );
  color: white;
  text-align: center;
}

.container {
  padding: 20px;
  max-width: 700px;
  margin: auto;
}

h1 {
  font-size: 4rem;
  margin: 0 0 10px 0;
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.8;
  margin: 0 0 20px 0;
}

#logo {
  width: 350px;
  height: auto;
  filter: drop-shadow(0 0 10px #00ff99);
  margin-bottom: 20px;
}

/* VIDEO CONTAINER */
#videoContainer {
  position: relative;
  width: fit-content;
  margin: 20px auto;
}

#video {
  width: 100%;
  max-width: 650px;
  border-radius: 20px;
  border: 2px solid #00ff99;
  box-shadow: 0 0 30px rgba(0, 255, 153, 0.5);
  filter: contrast(1.1) saturate(1.2) brightness(0.95);
  display: block;
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  pointer-events: none;
}

/* HUD EFFECTS */
#videoContainer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(0, 255, 153, 0.08) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(0, 255, 153, 0.08) 1px, transparent 1px);
  background-size: 30px 30px;
  border-radius: 20px;
  pointer-events: none;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hudCorner {
  position: absolute;
  width: 40px;
  height: 40px;
  border-color: #00ff99;
}

.topLeft {
  top: 10px;
  left: 10px;
  border-top: 4px solid;
  border-left: 4px solid;
}

.topRight {
  top: 10px;
  right: 10px;
  border-top: 4px solid;
  border-right: 4px solid;
}

.bottomLeft {
  bottom: 10px;
  left: 10px;
  border-bottom: 4px solid;
  border-left: 4px solid;
}

.bottomRight {
  bottom: 10px;
  right: 10px;
  border-bottom: 4px solid;
  border-right: 4px solid;
}

#scanLine {
  position: absolute;
  left: 0;
  width: 100%;
  height: 4px;
  background: #00ff99;
  box-shadow: 0 0 20px #00ff99;
  animation: scannerMove 2s linear infinite;
}

@keyframes scannerMove {
  0% {
    top: 0%;
  }
  100% {
    top: 100%;
  }
}

/* STATUS PANEL */
#statusPanel {
  margin-top: 15px;
  font-family: monospace;
  color: #00ff99;
  opacity: 0.9;
}

#statusPanel p {
  margin: 5px 0;
  font-size: 0.9rem;
}

/* BUTTONS */
button {
  margin-top: 20px;
  padding: 15px 30px;
  font-size: 1.2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: #b6ff00;
  color: black;
  font-weight: bold;
  transition: all 0.3s ease;
}

button:hover {
  background: #00ff99;
  box-shadow: 0 0 20px rgba(0, 255, 153, 0.5);
  transform: scale(1.05);
}

button:active {
  transform: scale(0.98);
}

/* LOADING STATE */
#loading {
  margin-top: 30px;
  background: #081522;
  padding: 30px;
  border-radius: 20px;
  border: 2px solid #00ff99;
  position: relative;
  overflow: hidden;
}

#loading h2 {
  color: #00ff99;
  letter-spacing: 4px;
  margin-top: 0;
}

#loadingText {
  margin-top: 20px;
  font-size: 1.1rem;
  min-height: 30px;
  color: #d6ffe8;
  animation: pulse 1s infinite;
}

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

#progressBarContainer {
  width: 100%;
  height: 20px;
  background: #13273d;
  border-radius: 20px;
  overflow: hidden;
  margin-top: 20px;
}

#progressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00ff99, #b6ff00);
  transition: width 0.3s;
}

#progressText {
  margin-top: 10px;
  font-size: 1.3rem;
  color: #b6ff00;
}

.scanner {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 4px;
  background: #00ff99;
  box-shadow: 0 0 20px #00ff99;
  animation: scan 2s infinite linear;
}

@keyframes scan {
  0% {
    top: 0%;
  }
  100% {
    top: 100%;
  }
}

#metricsLive {
  margin-top: 20px;
  font-family: monospace;
  text-align: left;
  background: #0d1f36;
  padding: 15px;
  border-radius: 10px;
  color: #00ff99;
  font-size: 0.9rem;
}

/* RESULT STATE */
#result {
  margin-top: 30px;
  background: #10233d;
  padding: 20px;
  border-radius: 20px;
}

#animalName {
  font-size: 3rem;
  margin: 20px 0 10px 0;
}

#animalImage {
  width: 250px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto 0;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 255, 153, 0.3);
  transition: transform 0.3s ease;
}

#animalImage:hover {
  transform: scale(1.05);
}

#animalDescription {
  font-size: 1.1rem;
  margin: 15px 0;
  color: #d6ffe8;
}

#score {
  font-size: 1.5rem;
  color: #b6ff00;
  font-weight: bold;
  margin: 15px 0;
}

/* UTILITY */
.hidden {
  display: none;
}
