/* Import Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Ubuntu+Sans+Mono:ital,wght@0,400..700;1,400..700&display=swap");

/* Define CSS variables for theme colors */
:root {
  --bg-color: #000000;
  --menu-color: #4c4d5b;
  --word-color: #eae0c8;
  --word-color-wrong: #D32F2F;
  --word-color-correct: #4CAF50;
  --accent-color: white;
  --caret-color: white;
  --menu-font-color: #252525;
  --caret-color: rgb(90, 90, 90);
  --menu-font-color: #ffffff;
  /* --bg-gradient: linear-gradient(0deg, #000000 0%, #001f6c 50%, #ffffff 100%); */
  --bg-gradient: linear-gradient(0deg, #000000 0%,#000064 50%, #4371bf 100%);
}

/* Apply box-sizing and margin reset to all elements */
* {
  box-sizing: border-box;
  margin: 0;
  font-family: "Ubuntu Sans Mono", monospace;
}

/* Set width and height to 100% for html and body */
html,
body {
  width: 100%;
  height: 110%;
}

/* Header styling */
header {
  background-color: #4371bf;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  color: white;
  margin: 0;
  font-size: 2rem;
}

header nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

header nav ul li {
  margin: 0 1rem;
}

header nav ul li a {
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
}

header nav ul li a:hover {
  text-decoration: underline;
}

/* Main content styling */
main {
  height: 90%;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  background: var(--bg-gradient);
  /* background-color: var(--bg-color); */
  align-items: center;
  gap: 20px;
  padding-top: 5rem;
}

/* Menu styling */
.menu {
  display: flex;
  gap: 0.5rem;
  color: var(--menu-font-color);
  background-color: var(--menu-color);
  border-radius: 6px;
  padding: 0.5rem 1.5rem 0.5rem 1.5rem;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);

}

.menu [menu-options-wrapper] {
  display: flex;
  gap: 0.5rem;
}

.menu [menu-options-wrapper]:not([active]),
.hidden {
  display: none !important;
}

.menu-item {
  user-select: none;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
}

.menu-item:hover {
  color: var(--accent-color);
}

.menu .spacer {
  width: 3px;
  height: 100%;
  margin: 0 8px 0 8px;
  align-self: center;
  background-color: var(--bg-color);
  border-radius: 2px;
}

.menu-item[active] {
  color: var(--accent-color);
  font-weight: bold;
}

/* Restart button styling */
#restart-btn {
  font-size: 1.75rem;
  border: none;
  background: none;
  color: var(--accent-color);
  cursor: pointer;
  transition: transform 0.3s ease-out;
  justify-self: flex-end;
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);

}

#restart-btn:hover {
  transform: rotate(-90deg);
  color: var(--accent-color);
}

/* Words wrapper styling */
.words-wrapper {
  position: relative;
  max-width: 75%;
  width: 75%;
  height: 112px;
  overflow: hidden;
}

/* Words container styling */
.words-container {
  gap: 12px;
  display: flex;
  height: 152px;
  font-weight: 500;
  font-size: 1.5rem;
  flex-wrap: wrap;
  overflow: hidden;
  align-content: flex-start;
  transition: all 250ms ease;
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);

}

/* Word styling */
.word {
  user-select: none;
  color: var(--word-color);
  transition: all 120ms;
}

.word span.correct {
  color: var(--word-color-correct);
}

.word span.wrong {
  color: var(--word-color-wrong);
}

.word span.extra {
  opacity: 0.6;
}

/* Timer styling */
.timer {
  color: var(--menu-font-color);
  font-weight: 600;
  font-size: 8rem;
  user-select: none;
  padding-top: 1rem;
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
}

/* Result styling */
.result {
  height: 2rem;
  color: var(--accent-color);
  font-size: 2rem;
  
}

/* Caret styling */
#caret {
  position: absolute;
  background-color: var(--caret-color);
  width: 2px;
  height: 30px;
  transition: all 120ms;
}

#caret.blink {
  animation: caret-blink 1.5s steps(2) infinite;
}

@keyframes caret-blink {
  0% {
    opacity: 0;
  }
}

/* Footer styling */
.footer {
  background-color: #000000;
  color: #ffffff;
  padding: 2rem;
  text-align: center;
}

/* Social media links styling */
.social-media-links i {
  color: #f4f4f4;
  margin: 1rem;
  text-decoration: none;
}

.social-media-links a {
  text-decoration: none; /* Ensure no underline */
}

.about, .contact{
  color: #fff;
}

/* Responsive styles */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: center;
  }

  header h1 {
    font-size: 1.5rem;
    text-align: center;
    margin: 10px;
  }

  header nav ul {
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
  }

  header nav ul li {
    margin: 0;
  }

  main {
    padding-top: 2rem;
  }

  .menu {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .menu .spacer {
    display: none;
  }

  .timer {
    font-size: 4rem;
  }

  .result {
    font-size: 1.5rem;
  }

  .words-wrapper {
    max-width: 90%;
    height: auto;
  }

  .words-container {
    font-size: 1.2rem;
  }

  .footer {
      padding: 1rem;
    }

  .social-media-links i {
    margin: 0.5rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.2rem;
    text-align: center;
  }

  header nav ul {
    flex-direction: column;
    align-items: center;
  }

  header nav ul li a {
    font-size: 1rem;
  }

  .timer {
    font-size: 3rem;
  }

  .result {
    font-size: 1.2rem;
  }

  .words-container {
    font-size: 1rem;
  }
}

/* ABout styling */

.about-content {
  color: #fff;
  font-size: 1.2rem;
  width: 80%;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  margin: 1rem auto;
  background: linear-gradient(145deg, #333, #444);
  border: 1px solid #555;
  text-align: center;
  background-color: #252525;
}

/* contact styling */

.info {
  color: #fff;
  font-size: 1.1rem;
  width: 80%;
  max-width: 500px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  margin: 2rem auauto;
  background: linear-gradient(145deg, #333, #444);
  border: 1px solid #555;
  text-align: left;
  background-color: #252525;
}

.formi {
  color: #fff;
  font-size: 1.1rem;
  width: 80%;
  max-width: 500px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  margin: 2rem auauto;
  background: linear-gradient(145deg, #333, #444);
  border: 1px solid #555;
  text-align: left;
  background-color: #252525;
}

.formi input[type="text"],
.formi input[type="email"],
.formi textarea {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 1px solid #555;
  border-radius: 5px;
  background-color: #333;
  color: #fff;
}

.formi input[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  border: none;
  border-radius: 5px;
  background-color: #4CAF50;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.formi input[type="submit"]:hover {
  background-color: #45a049;
}
.formi button {
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  border: none;
  border-radius: 5px;
  background-color: #4CAF50;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.formi button:hover {
  background-color: #45a049;
}
