html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono";
  transition: background-color 0.3s, color 0.3s;
}

body::before, body::after{
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  background-repeat: no-repeat;
  background-size: cover;
  transition: opacity 0.8s ease;
}
body::before {
    background: linear-gradient(0deg, rgba(64, 224, 208, 1) 0%, rgba(102, 221, 170, 1) 100%);
    opacity: 1;
}
body.dark::before {
  opacity: 0;
}

.container {
  background-color: rgba(255, 255, 255, 0.5);
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

#chat {
  border: 1px solid #ccc;
  padding: 1rem;
  height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
}

.user {
  color: #007bff;
  margin-bottom: 0.5rem;
}

.bot {
  color: #28a745;
  margin-bottom: 0.5rem;
}

#chat > .user,
#chat > .bot {
  font-size: 1rem !important;
  line-height: 1.4 !important;
  white-space: pre-wrap;
}

#input-container {
  display: flex;
  gap: 0.5rem;
}

input[type="text"] {
  flex-grow: 1;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}

button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background-color: #0ecf98;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background-color: #0aa67a;
}

.typing {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid #000;
  width: 0;
  animation: typing 3s steps(40, end) forwards, blink 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink {
  50% { border-color: transparent }
}

h1 {
  font-size: 1.63rem;
}

.dots {
  display: inline-block;
  width: 1.5em;
  text-align: left;
}

.dots::after {
  content: '';
  display: inline-block;
  animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  33%  { content: '.'; }
  66%  { content: '..'; }
  100% { content: '...'; }
}

#daily-challenge-box {
  background-color: #fffbe6;
  border: 1px solid #ffdf80;
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 1rem;
  color: #9a6b00;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

#daily-challenge {
  flex: 1;
  font-weight: bold;
  text-align: left;
}

#theme-toggle {
  position: absolute;
  right: 9vw;
  z-index: 1000;
  padding: 0.8em;
  font-size: 1.4rem;
  background-color: #444;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: all 0.8s ease;
}

#theme-toggle:hover {
  background-color: #666;
}

@media (max-width: 500px) {
  #theme-toggle {
    right: 3vw;
    bottom: 5vh;
  }
}

body::before, body, button, h1, #daily-challenge-box {
  transition: background-color 0.4s ease, color 0.4s ease;
}

body::after{
  background: #8D4585;
  background: linear-gradient(180deg, rgba(141, 69, 133, 1) 0%, rgba(128, 5, 23, 1) 100%);
  opacity: 0;
}
body.dark::after{
  opacity: 1;
}
body.dark button{
  background-color: #d1699f;
  color: antiquewhite;
}
body.dark button:hover{
  background-color: #a94f7d;
}

body.dark #daily-challenge-box {
  background-color: #a6519c;
  border: 1px solid #c79de3;
  color: antiquewhite;
}

body.dark h1{
  color: antiquewhite;
}

button:disabled, body.dark button:disabled {
  background-color: #CF142B;
  cursor: not-allowed;
  transition: all 0.8s ease;
}