:root {
  --primary-color: #3f51b5;
  --secondary-color: #ff4081;
  --background-start: #e8eaf6;
  --background-end: #c5cae9;
  --text-color: #212121;
  --white-color: #fff;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

body[data-theme='dark'] {
  --primary-color: #7986cb;
  --secondary-color: #ff80ab;
  --background-start: #282c34;
  --background-end: #20232a;
  --text-color: #f0f2f5;
  --white-color: #424242;
  --shadow-color: rgba(255, 255, 255, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  background-image: linear-gradient(to top, var(--background-start) 0%, var(--background-end) 100%);
  color: var(--text-color);
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
  transition: background-color 0.3s, color 0.3s;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><g fill-opacity="0.05"><circle fill="%233f51b5" cx="400" cy="400" r="600"/><circle fill="%23ff4081" cx="400" cy="400" r="500"/><circle fill="%23e8eaf6" cx="400" cy="400" r="300"/><circle fill="%23c5cae9" cx="400" cy="400" r="200"/><circle fill="%23212121" cx="400" cy="400" r="100"/></g></svg>');
  opacity: 0.3;
  z-index: -1;
}

h1 {
  color: var(--primary-color);
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 0.5em;
  text-shadow: 1px 1px 2px var(--shadow-color);
}

.theme-switcher-container {
  position: absolute;
  top: 20px;
  right: 20px;
}

#theme-switcher {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#theme-switcher:hover {
  background-color: var(--secondary-color);
}

header {
  width: 100%;
  padding: 1rem 0;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 2rem;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s;
}

nav a:hover {
  color: var(--primary-color);
}

.main-container {
  background-color: var(--white-color);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 15px 35px var(--shadow-color);
  text-align: center;
  max-width: 500px;
  margin: 100px auto 0; /* Adjusted margin to account for header */
  transition: background-color 0.3s;
}

#webcam-container {
  margin: 2rem auto;
  width: 200px;
  height: 200px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 20px var(--shadow-color);
}

#label-container {
  margin-top: 1.5rem;
  font-size: 1.5rem;
  font-weight: bold;
}

.ad-placeholder {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
  height: 100px;
  background-color: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #555;
  font-size: 1.2rem;
  border-radius: 10px;
}

