@import url("https://fonts.googleapis.com/css2?family=Cal+Sans&display=swap");

html {
  scroll-behavior: smooth;
}

:root {
  --colorAccent: #555;
  --colorTextPrimary: #d6d6d6;
  --colorBG: #141414;
  --colorSurface: #222;
  --colorOverlayWeak: rgba(20, 20, 20, 0.7);
  --colorOverlayStrong: rgba(20, 20, 20, 0.8);
  --colorBorder: #444;
  --colorMuted: #333;
  /* Light Mode */
  --colorErroe: #360000;
  --LMcolorAccent: #aaa;
  --LMcolorTextPrimary: #333;
  --LMcolorBG: #f5f5f5;
  --LMcolorSurface: #eee;
  --LMcolorOverlayWeak: rgba(207, 207, 207, 0.5);
  --LMcolorOverlayStrong: rgba(194, 194, 194, 0.8);
  --LMcolorBorder: #ddd;
  --LMcolorMuted: #ccc;
  --icon-fill-color: #d6d6d6;
}

.dark-mode {
  --icon-fill-color: #d6d6d6;
}

.light-mode {
  --icon-fill-color: #333;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--colorBorder);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--colorTextPrimary);
  border-radius: 12px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--colorAccent);
}

body {
  background: var(--colorBG);
  overflow-x: hidden;
  margin: 0;
  font-family: "Cal Sans", Arial, sans-serif;
  color: var(--colorTextPrimary);
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
}

body.light-mode {
  background-color: var(--LMcolorBG);
  color: var(--LMcolorTextPrimary);
}

.light-mode #theme-toggle {
  border: 1px solid var(--LMcolorTextPrimary);
}

.light-mode #theme-toggle svg {
  fill: var(--LMcolorTextPrimary);
}

#theme-toggle {
  position: fixed;
  right: 20px;
  top: 10px;
  height: 50px;
  width: 50px;
  padding: 0;
  border: 1px solid var(--colorTextPrimary);
  border-radius: 50%;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#theme-toggle svg {
  fill: var(--colorTextPrimary);
  display: block;
}

#theme-toggle svg:last-child {
  display: none;
}

.light-mode #theme-toggle svg {
  display: none;
}

.light-mode #theme-toggle svg:last-child {
  display: block;
}

#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  filter: blur(7px);
}

#content-wrapper {
  position: relative;
  z-index: 1;
  background-color: var(--colorOverlayWeak);
  padding: 20px;
  min-height: 100vh;
}

.light-mode #content-wrapper {
  background-color: var(--LMcolorOverlayWeak);
}

header {
  padding: 20px 0;
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: 2px;
  font-weight: 500;
  margin-bottom: 20px;
}

h2,
h4,
h3,
label {
  font-weight: 300;
  letter-spacing: 1px;
}

ul li,
ol li {
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  flex-wrap: wrap;
  gap: 15px;
}

li > ul {
  list-style: none;
  margin: 1.2rem;
}

nav ul li {
  margin-bottom: 1rem;
}

.styled-a {
  color: var(--colorTextPrimary);
  text-decoration: none;
  padding: 8px 15px;
  border: 1px solid var(--colorTextPrimary);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.light-mode .styled-a {
  color: var(--LMcolorTextPrimary);
  border: 1px solid var(--LMcolorTextPrimary);
}

.styled-a:hover {
  background-color: var(--colorTextPrimary);
  color: var(--colorBG);
}

.light-mode .styled-a:hover {
  background-color: var(--LMcolorTextPrimary);
  color: var(--LMcolorBG);
}

.content-box {
  margin: 30px 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  background: var(--colorOverlayStrong);
  padding: 0.3rem 2rem 1rem;
  border-radius: 10px;
}

footer {
  margin: 30px 0;
  max-width: 400px;
  margin: auto;
  text-align: center;
  padding: 0.1rem 1rem 0.1rem;
  border-radius: 10px;
  background-color: var(--colorOverlayStrong);
}

.light-mode footer {
  background-color: var(--LMcolorOverlayStrong);
}

.light-mode .content-box {
  background: var(--LMcolorOverlayStrong);
}

.content-box p {
  letter-spacing: 1px;
  font-weight: 300;
}

#cont {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--colorOverlayStrong);
  padding: 20px;
  border-radius: 10px;
}

.light-mode #cont {
  background: var(--LMcolorOverlayStrong);
}

.generation {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

.generation form {
  flex: 1;
  min-width: 300px;
}

.divider {
  width: 1px;
  background: var(--colorAccent);
  margin: 0 10px;
}

.light-mode .divider {
  background: var(--LMcolorAccent);
}

textarea,
input[type="number"],
input[type="text"] {
  width: 90%;
  padding: 8px;
  margin: 5px 0;
  background: var(--colorSurface);
  border: 1px solid var(--colorBorder);
  color: var(--colorTextPrimary);
  border-radius: 6px;
  font-family: inherit;
  font-weight: 300;
  letter-spacing: 1px;
}

.light-mode textarea,
.light-mode [type="number"],
.light-mode [type="text"] {
  background: var(--LMcolorSurface);
  border: 1px solid var(--LMcolorBorder);
  color: var(--LMcolorTextPrimary);
}

button {
  background: var(--colorMuted);
  color: var(--colorTextPrimary);
  border: 1px solid var(--colorAccent);
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}

.light-mode button {
  background: var(--LMcolorMuted);
  color: var(--LMcolorTextPrimary);
  border: 1px solid var(--LMcolorAccent);
}

button:hover {
  background: var(--colorBorder);
}

.light-mode button:hover {
  background: var(--LMcolorBorder);
}

.upload_content {
  border: 2px dashed var(--colorAccent);
  padding: 20px;
  text-align: center;
  margin: 10px 0;
  cursor: pointer;
}

.light-mode .upload_content {
  border: 2px dashed var(--LMcolorAccent);
}

#output {
  margin: 20px auto;
  max-width: 800px;
  background: var(--colorOverlayStrong);
  padding: 20px;
  border-radius: 10px;
}

.light-mode #output {
  background: var(--LMcolorOverlayStrong);
}

#extra-text {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  margin-top: 5px;
}

#predict:focus + #extra-text {
  max-height: 50px;
  opacity: 1;
}

.light-mode #predict:focus + #extra-text {
  color: var(--LMcolorTextPrimary);
}

.message-area {
  position: fixed;
  top: 1rem;
  right: 1rem; /* top right corner */
  z-index: 9999;
}

.message-text {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--colorBG);
  border: 1px solid #aaa;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(-20px);
  animation: slideIn 0.6s ease-out forwards;
}

.light-mode .message-text {
  background: var(--LMcolorBG);
  border: 1px solid #555;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 350px) {
  .upload_content {
    width: 70%;
  }

  textarea,
  input[type="number"],
  input[type="text"] {
    width: 80%;
  }

  #content-wrapper {
    min-width: 90%;
  }
}

@media (min-width: 380px) {
  .upload_content {
    width: 80%;
  }

  textarea,
  input[type="number"],
  input[type="text"] {
    width: 80%;
  }

  #content-wrapper {
    min-width: 90%;
  }
}

@media (max-width: 768px) {
  .generation {
    flex-direction: column;
  }

  .divider {
    height: 1px;
    width: 100%;
    margin: 20px 0;
  }
}

@media (min-width: 770px) and (max-width: 1050px) {
  #divider-id {
    width: 100%;
    height: 1px;
  }

  textarea,
  input[type="number"],
  input[type="text"] {
    width: 90%;
  }
}
