/* Reset Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* HTML and Body Full Screen */
html, body {
  height: 100%;
  width: 100%;
  font-family: 'Courier New', Courier, monospace;
  color: #ffffff;
  overflow-x: hidden;
}

/* Timer Display */
#timerDisplay {
  font-family: 'Inter', sans-serif !important;
  font-size: clamp(4rem, 11vw, 6.15rem);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  max-width: 90%;
}

/* Real Time Display */
#realTime {
  position: fixed;
  top: 1rem;
  right: 1rem;
  text-align: right;
  font-size: 0.875rem;
  font-family: monospace;
  opacity: 0.7;
  z-index: 1000;
  display: flex !important;
  flex-direction: column;
  gap: 0.5rem;
}

#realClock, #realDate {
  display: block;
  width: 100%;
  text-align: right;
}

/* Dashboard, Settings, and Scanner Modal */
#dashboardModal, #settingsModal, #scannerModal, #timeModal {
  max-width: 90%;
  overflow-y: auto;
  z-index: 40;
  display: none !important;
}

#dashboardModal.active, #settingsModal.active, #scannerModal.active, #timeModal.active {
  display: flex !important;
}

/* Today Usage and Daily Average Animation */
#todayUsage, #dailyAverage {
  display: inline-block;
  animation: slideUpNumber 1s ease-out forwards;
}

/* Chat Container */
#chatContainer {
  width: 380px !important;
  height: 475px !important;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: #1f2937 !important;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  z-index: 40;
}

/* Scanner Video */
#scannerVideo {
  width: 100%;
  height: auto;
  background-color: #000;
}

/* Settings and Dashboard Buttons */
#settingsBtn, #dashboardBtn {
  touch-action: manipulation;
  z-index: 1000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Fix Restart Button Position */
.fixed-position {
  position: relative;
  z-index: 10;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUpNumber {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Media Queries: PC and Large Screens */
@media (min-width: 768px) {
  #chatContainer {
    width: 380px !important;
    height: 475px !important;
  }
  #dashboardModal, #settingsModal, #scannerModal, #timeModal {
    max-width: 50%;
    padding: 20px;
  }
  #realTime {
    font-size: 1rem;
    display: flex !important;
    flex-direction: column;
    gap: 0.2rem;
  }
  #realClock, #realDate {
    display: block;
    width: 100%;
    text-align: right;
  }
}

@media (min-width: 1024px) {
  #dashboardModal, #settingsModal, #scannerModal, #timeModal {
    max-width: 40%;
    padding: 16px;
  }
}

/* Media Queries: Mobile Screens */
@media (max-width: 768px) {
  body {
    background-color: #1A1A1A !important;
  }
  #realTime {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
    display: flex !important;
    flex-direction: column;
    gap: 0.4rem;
  }
  #realClock, #realDate {
    display: block;
    width: 100%;
    text-align: right;
  }
  #chatContainer {
    width: 90% !important;
    height: 60vh !important; /* Reduced height for mobile */
    right: 0.5rem;
    bottom: 0.5rem;
  }
  #dashboardModal, #settingsModal, #scannerModal, #timeModal {
    max-width: 90%;
    padding: 15px;
  }
  #settingsBtn, #dashboardBtn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  /* Reduce size of Set Time, Start, and Restart buttons */
  #setTimeBtn, #startBtn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  #restartBtn {
    padding: 0.5rem;
  }
  #restartBtn svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 393px) {
  #dashboardModal, #settingsModal, #scannerModal, #timeModal {
    max-width: 100%;
    padding: 10px;
  }
  #timerDisplay {
    font-size: clamp(3rem, 10vw, 4.5rem);
    font-family: 'Inter', sans-serif !important;
  }
  #realTime {
    font-size: 0.65rem;
    display: flex !important;
    flex-direction: column;
    gap: 0.1rem;
  }
  #realClock, #realDate {
    display: block;
    width: 100%;
    text-align: right;
  }
  .text-xl { font-size: 1.25rem; }
  .text-lg { font-size: 1rem; }
  .space-x-4 { gap: 0.5rem; }
  /* Further reduce size of Set Time, Start, and Restart buttons */
  #setTimeBtn, #startBtn {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
  #restartBtn {
    padding: 0.4rem;
  }
  #restartBtn svg {
    width: 16px;
    height: 16px;
  }
}

body {
  background-color: #1A1A1A !important;
  color: #ffffff;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  animation: fadeIn 0.5s ease-in;
}