:root {
  --color-primary: #ff7043;
  --color-secondary: #4caf50;
  --color-upload: #3577ce;
  --color-danger: hsl(4, 90%, 58%);
  --color-background: #f8f8f8;
  --color-surface: #ffffff;
  --color-text: #242424;
  --color-text-2: #ffffff;
  --color-text-light: #353535;
  --font-family: "Poppins", sans-serif;
  --border-radius: 12px;
}

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

body {
  font-family: var(--font-family);
  color: var(--color-text);
  line-height: 1.6;

  background-color: var(--color-background); /* kalau gambarnya ga ke load */
  background-image: url("./Assets/BackgroundMeaty.webp");
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  background-position: center center;
}

.content-wrapper {
  min-height: 100vh;
  background-color: #000000b3;
}

header {
  background-color: var(--color-surface);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--color-primary);
}

.logo .emoji {
  margin-right: 5px;
}

nav a {
  color: var(--color-text-light);
  text-decoration: none;
  margin-left: 25px;
  font-weight: 500;
  padding: 5px 0;
  transition: color 0.3s, border-bottom 0.3s;
}

nav a:hover,
nav a.active {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
}

main,
.detector-section {
  min-height: calc(100vh - 80px);
  padding: 60px 5%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  font-size: 3em;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 15px;
}

h2 {
  font-size: 2em;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(255, 112, 67, 0.1);
  padding-bottom: 10px;
}

h3 {
  font-size: 1em;
  font-weight: 400;
  color: var(--color-text-2);
  margin-bottom: 20px;
}

h4 {
  font-size: 1em;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 10px;
}

.hero-section {
  text-align: center;
  padding: 80px 50px;
  background: linear-gradient(
    135deg,
    var(--color-surface) 0%,
    rgba(255, 112, 67, 0.05) 100%
  );
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-text p {
  font-size: 1.2em;
  width: 600px;
  overflow-wrap: break-word;
  @media (max-width: 768px) {
    width: 250px;
  }
  color: var(--color-text-light);
  margin-bottom: 10px;
}

.how-section {
  padding: 60px 0 60px;
  scroll-margin-top: 120px;
}

.how-container {
  width: min(1100px, 90%);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.how-header {
  text-align: center;
  max-width: 600px;
  margin: auto;
}

.tagline {
  font-size: 14px;
  font-weight: 600;
  color: #1f4fa0;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.how-header h2 {
  font-size: 32px;
  color: #242424;
  margin-bottom: 12px;
}

.how-header p {
  color: #6b6b6b;
  font-size: 16px;
  line-height: 1.6;
}

.how-step {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 10px;
}

.icon-box {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #d7dce5;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 0px 0px 4px rgba(7, 46, 106, 0.05);
}

.icon-box img {
  width: 28px;
  height: 28px;
}

.how-step h3 {
  font-size: 20px;
  font-weight: bold;
  color: white;
  margin-bottom: 0px;
}

.how-step p {
  color: white;
  font-size: 15px;
  line-height: 1.5;
}

.how-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;

  @media (min-width: 768px) {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  @media (min-width: 1024px) {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cta-button,
.control-button {
  padding: 12px 25px;
  border: none;
  border-radius: 50px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cta-button {
  background-color: var(--color-primary);
  color: var(--color-surface);
  box-shadow: 0 4px 10px rgba(255, 112, 67, 0.4);
  margin-top: 30px;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 112, 67, 0.5);
}

.detection-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: var(--color-surface);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.camera-feed {
  width: 100%;
  max-height: 300px;
  aspect-ratio: 16 / 9;
  background-color: #e0e0e0;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-text-light);
  font-style: italic;
}

#video-stream,
#canvas-capture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#feed-placeholder {
  position: absolute;
  font-size: 1.2em;
  text-align: center;

   @media (max-width: 768px) {
    font-size: 1em;

  }
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.control-button {
  padding: 10px 20px;
  border-radius: 50px;
  display: flex;
  justify-content: center;
  font-size: 0.95em;

  @media (max-width: 768px) {
    flex: 1 1 100%;
    max-width: 300px;
  }
}

.control-button.primary {
  background-color: var(--color-secondary);
  color: var(--color-surface);
}

.control-button.primary:hover {
  background-color: #43a047;
}

.control-button.upload {
  background-color: var(--color-upload);
  color: var(--color-surface);
}

.control-button.upload:hover {
  background-color: #20578f;
}

.control-button.secondary {
  background-color: #ffb74d;
  color: var(--color-text);
}

.control-button.secondary:hover {
  background-color: #ffa726;
}

.control-button.danger {
  background-color: var(--color-danger);
  color: var(--color-surface);
}

.control-button.danger:hover {
  background-color: #e53935;
}

.control-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.result-box {
  margin-top: 30px;
  padding: 25px;
  border-radius: var(--border-radius);
  min-height: 100px;
  background-color: #f0f4f7;
  border: 1px solid #e0e0e0;
  text-align: center;
}

.result-box.good {
  border-color: var(--color-secondary);
  background-color: #e8f5e9;
}

.result-box.bad {
  border-color: var(--color-danger);
  background-color: #ffebee;
}

.result-box h3 {
  font-size: 1.5em;
  margin-bottom: 10px;
}

.result-box p {
  font-size: 1.1em;
}

.result-box .emoji {
  font-size: 2em;
  display: block;
  margin-bottom: 5px;
}

footer {
  /*  */
  
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 5%;
  background-color: var(--color-text);
  color: var(--color-surface);
  font-size: 0.9em;
   @media (max-width: 768px) {
    text-align: start;
  }
}

/* footer p {
  position: absolute;
  margin: 0 ;
  left: 60%;
  transform: translateX(-50%);
  @media (max-width: 768px) {
    transform: translateX(0%);
  }
} */

footer a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: white;
  gap: 5px;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.5em;
  }

  nav {
    display: none;
  }

  header {
    justify-content: center;
  }

  .hero-section {
    padding: 50px 15px;
  }
}
