body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #1d1d1f;
  background-color: #fbfbfd;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#webcam, #overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#eyes {
  position: absolute;
  top: 20px;
  left: 440px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: none;
}

#overlay {
  display: none;
}

#target {
  background: linear-gradient(135deg, #f9a66c, #f27121);
  position: absolute;
  border-radius: 50%;
  height: 40px;
  width: 40px;
  transition: all 0.1s ease;
  opacity: 0;
}

footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  text-align: center;
  color: #86868b;
  font-size: 12px;
  padding: 1em;
  letter-spacing: -0.01em;
}

a {
  color: #cf7e45;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #e8864b;
}

footer .fa-heart {
  color: #e8864b;
}

@-webkit-keyframes flash {
  from,
  50%,
  to {
    opacity: 1;
  }

  25%,
  75% {
    opacity: 0;
  }
}

@keyframes flash {
  from,
  50%,
  to {
    opacity: 1;
  }

  25%,
  75% {
    opacity: 0;
  }
}

#info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 17px;
  background-color: #ffffff;
  padding: 2em;
  border-radius: 18px;
  max-width: 500px;
  transition: all 0.3s ease;
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  line-height: 1.47059;
  letter-spacing: -0.022em;
  font-weight: 400;
}

#info h3 {
  margin: 0 0 0.8em 0;
  color: #1d1d1f;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.003em;
  line-height: 1.14286;
  background: linear-gradient(135deg, #f9a66c, #f27121);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

#info.flash {
  -webkit-animation-name: flash;
  animation-name: flash;
}

#close-help {
  position: absolute;
  top: 15px;
  right: 15px;
}

#training, #session, #heatmap {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 320px;
  background-color: #ffffff;
  padding: 1.5em;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.panel-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
}

.panel-header-buttons {
  display: flex;
  gap: 8px;
}

.panel-content.collapsed {
  display: none;
}

.icon-button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f9a66c, #f27121);
  color: white;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
}

.icon-button:hover {
  transform: scale(1.1);
}

#training-progress {
  display: none;
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  text-align: center;
  width: 300px;
  font-size: 14px;
}

#settings-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 250px;
  background-color: #ffffff;
  padding: 1.5em;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  z-index: 1000;
}

.hidden {
  display: none !important;
}

#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
}

#help-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #ffffff;
  padding: 2em;
  border-radius: 18px;
  max-width: 500px;
  z-index: 101;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.settings-content {
  margin-top: 15px;
}

.setting-group {
  margin-bottom: 15px;
}

.setting-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #1d1d1f;
}

.slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #f0f0f0;
  outline: none;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f9a66c, #f27121);
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f9a66c, #f27121);
  cursor: pointer;
  border: none;
}

select {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background-color: #f9f9f9;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #1d1d1f;
  outline: none;
}

select:focus {
  border-color: #f9a66c;
}

/* Target shape styles */
.target-circle {
  border-radius: 50%;
}

.target-square {
  border-radius: 0;
}

.target-triangle {
  width: 0 !important;
  height: 0 !important;
  background: none !important;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 40px solid;
  border-bottom-color: inherit;
}

.target-star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Target color styles */
.color-default {
  background: linear-gradient(135deg, #f9a66c, #f27121);
}

.color-blue {
  background: linear-gradient(135deg, #6ab7ff, #1a56e8);
}

.color-green {
  background: linear-gradient(135deg, #7cffcb, #00c362);
}

.color-purple {
  background: linear-gradient(135deg, #c17aff, #7a1aff);
}

.color-red {
  background: linear-gradient(135deg, #ff7a7a, #ff1a1a);
}

.status-panel, .training-data-panel {
  margin-bottom: 1em;
  background-color: #f9f9f9;
  border-radius: 12px;
  padding: 5px;
}

.status-panel table, .training-data-panel table {
  width: 100%;
  font-size: 14px;
  font-weight: 400;
  border-collapse: collapse;
}

.status-panel table tr, .training-data-panel table tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.status-panel table tr:last-child, .training-data-panel table tr:last-child {
  border-bottom: none;
}

.status-panel table td, .training-data-panel table td {
  padding: 10px;
  color: #1d1d1f;
}

.status-panel table td:nth-child(2), .training-data-panel table td:nth-child(2) {
  text-align: right;
  font-weight: 500;
  color: #cf7e45;
}

[data-content="face-detected"].detected {
  color: #28a745!important; /* A green color */
  font-weight: bold;
}

[data-content="face-detected"].not-detected {
  color: #dc3545!important; /* A red color */
  font-weight: bold;
}

[data-content="webcam-status"].connected {
  color: #28a745!important; /* A green color */
  font-weight: bold;
}

[data-content="webcam-status"].disconnected {
  color: #dc3545!important; /* A red color */
  font-weight: bold;
}

#spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: #f27121;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.buttonwrap {
  text-align: center;
}

.button-group {
  margin-bottom: 1em;
  padding: 12px;
  background-color: #f9f9f9;
  border-radius: 12px;
}

#session-start-container {
  display: none;
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.buttonrow {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

button {
  position: relative;
  z-index: 11;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 16px;
  margin: 0;
  width: 140px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #e9e9eb;
  color: #1d1d1f;
  border: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
}

button#start-detection, button.emph {
  background: linear-gradient(135deg, #f9a66c, #f27121);
  color: white;
  font-weight: 600;
}

button:hover {
  background: linear-gradient(135deg, #fbb07d, #ff8132);
  transform: translateY(-1px);
}

button:active {
  background: linear-gradient(135deg, #e89c65, #e06a1e);
  transform: translateY(1px);
}

button:disabled {
  background: #f5f5f7;
  color: #86868b;
  cursor: not-allowed;
  transform: none;
}

#heatMap {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 10;
  pointer-events: none;
}

#data-uploader, #model-uploader {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  #webcam, #overlay {
    width: 350px;
    height: 262px;
  }
  
  #eyes {
    left: 390px;
  }
}

@media (max-width: 992px) {
  #webcam, #overlay {
    width: 300px;
    height: 225px;
  }
  
  #eyes {
    left: 340px;
  }
  
  #training {
    width: 280px;
  }
}
