* {
  color: #ffebf3;
  line-height: 1.6;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}

.camcontainer {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 1200px;
  background-color: transparent;
  padding: 2rem;
  border-radius: 15px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.5s ease-in;
  justify-content: space-between;
  gap: 2rem;
  align-items: start;
}

.cam_content {
  margin: 0 auto;
  text-align: center;
}

h1,
h2 {
  text-align: center;
  animation: slideDown 0.5s ease-out;
  color: #fff;
  text-shadow: 0 2px 4px rgba(255, 105, 180, 0.6);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

p {
  font-size: 1.1rem;
  color: #ffeff7;
  margin-bottom: 2rem;
}

.camera-section,
.upload-section {
  background: rgba(255, 105, 180, 0.15);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  transition: transform 0.3s ease;
  border: 2px solid #ff4f58;
  width: 100%;
  max-width: 400px;
}

.camera-section:hover,
.upload-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 0px 32px rgba(255, 30, 120, 0.8);
}

video,
#capturedImage {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  display: block;
  margin: 1rem auto;
  box-shadow: 0 0px 32px rgba(255, 30, 120, 0.5);
}

.button-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
  flex-wrap: wrap;
}

button {
  background: #ff4c4c;
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-in;
  box-shadow: 0px 5px 20px rgba(255, 105, 180, 0.3);
}

button:hover:not(:disabled) {
  background: #ff6b6b;
  transform: scale(1.05);
  box-shadow: 0 0 15px #ff5656;
}

button:disabled {
  background: #ffb3d9;
  cursor: not-allowed;
}

#uploadForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

input[type="file"],
input[type="url"] {
  padding: 0.8rem;
  border-radius: 5px;
  border: 1px solid #ff4da6;
  background: rgba(255, 255, 255, 0.8);
  color: #333;
}

input[type="url"]::placeholder {
  color: #9ca3af;
}

#result {
  width: 100%;
  min-height: 80vh;
  overflow: auto;
  margin-top: 2rem;
  background: rgba(255, 105, 180, 0.15);
  color: #fff;
  padding: 1.5rem;
  border-radius: 10px;
  animation: slideUp 0.5s ease-out;
  border: 2px solid #ff4f58;
  box-shadow: 0 0px 32px rgba(255, 30, 120, 0.5);
  line-height: 1.6;
}

#result h1,
#result h2,
#result h3 {
  color: #fff;
  margin: 1rem 0;
  text-align: left;
}

#result ul,
#result ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

#result li {
  margin-bottom: 0.5rem;
}

#result p {
  margin-bottom: 1rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

canvas {
  display: none;
}

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
  .camcontainer {
    flex-direction: column;
    padding: 1rem;
    gap: 1.5rem;
  }

  .camera-section,
  .upload-section {
    width: 100%;
    max-width: none;
    padding: 1rem;
  }

  video,
  #capturedImage {
    max-width: 100%;
    margin: 1rem 0;
  }

  button {
    padding: 0.6rem 1.2rem;
  }

  #result {
    margin-top: 1.5rem;
    padding: 1rem;
  }

  input[type="file"],
  input[type="url"] {
    padding: 0.7rem;
  }
}

@media screen and (max-width: 768px) {
  .camcontainer {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .camera-section,
  .upload-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  button {
    padding: 0.5rem 1rem;
  }

  #result {
    padding: 1rem;
    margin-top: 1rem;
  }
}

/* Loading Indicator */
.loading {
  text-align: center;
  font-size: 1.2rem;
  color: #fff; /* White text */
  margin-top: 10px;
  animation: pulse 1.5s infinite;
}

.loading.hidden {
  display: none;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}
