/* General Styles */
body {
  font-family: "Arial", sans-serif;
  margin: 0;
  padding: 0;
  text-align: center;
  background-color: #121212;
  /* Dark background */
  color: #5daeff;
  /* Light text for contrast */
}

/* Header */
header {
  background-color: #1e1e1e;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

#header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 1rem;
  text-align: center;
}

/* Header Logo */
#logo {
  height: 2.5rem; /* Match the height of the previous h1 font size */
  object-fit: contain; /* Ensure the logo scales proportionally */
  max-width: 100%; /* Prevent overflow */
  display: block;
  margin: 0 auto; /* Center the logo horizontally */
}

header h1 {
  font-size: 2.5rem;
  font-weight: bold;
  color: #5daeff;
}

#settings-icon img {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

#settings-icon img:hover {
  transform: scale(1.2);
}

.nav-links a,
.nav-icons a {
  text-decoration: none;
  color: #e0e0e0;
}

.nav-links a:hover,
.nav-icons a:hover {
  color: #ff8c00;
}

/* Styles for desktop */
@media (min-width: 769px) {
  .nav-links.desktop-only {
    display: flex;
    gap: 1rem;
  }

  .nav-links.desktop-only a {
    /* Style for desktop links */
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 5px;
  }

  .nav-icons.mobile-only {
    display: none;
  }

  .nav-links.desktop-only a:hover {
    background-color: #3a3a3a;
  }

  #tutorial .nav-links.desktop-only {
    display: block;
  }

  #tutorial .nav-icons.mobile-only {
    display: none;
  }
}

/* Styles for mobile */
@media (max-width: 768px) {
  .nav-links.desktop-only {
    display: none;
  }

  .nav-icons.mobile-only {
    display: flex;
    gap: 1rem;
  }

  .nav-icons.mobile-only img {
    /* Style for mobile icons */
    width: 24px;
    height: 24px;
  }

  #tutorial .nav-links.desktop-only {
    display: none;
  }

  #tutorial .nav-icons.mobile-only {
    display: block;
  }
}

/* Main Content */
main {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Containers (Scramble, Timer, Controls, History, Statistics) */
#scramble,
#timer,
#controls,
#history,
#statistics {
  width: 90%;
  max-width: 600px;
  background-color: #1e1e1e;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#tutorial {
  width: 81%;
  max-width: 600px;
  background-color: #1e1e1e;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Timer Display */
#time-display {
  font-size: 3.5rem;
  font-weight: bold;
  color: #76c7c0;
}

/* Buttons */
button {
  margin: 0.5rem;
  padding: 0.7rem 1.5rem;
  border: none;
  background-color: #3a3a3a;
  color: #e0e0e0;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
  background-color: #ff8c00;
  transform: translateY(-3px);
}

/* Solve History */
#solve-list {
  list-style-type: none;
  padding: 0;
  text-align: left;
  margin: 0;
}

#solve-list li {
  margin: 0.5rem 0;
  font-size: 1.2rem;
  background-color: #262626;
  padding: 0.7rem;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Theme Toggle */

#divider {
  margin: 2rem auto;
  width: 90%;
  /* Adjust width */
  max-width: 600px;
  border: none;
  height: 1px;
  background-color: #ccc;
  /* Light gray for light theme */
}

body.dark-theme #divider {
  background-color: #444;
  /* Dark gray for dark theme */
}

/* Style for both buttons to match */
#theme-toggle,
#settings-icon {
  background-color: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#theme-toggle img,
#settings-icon img {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

#theme-toggle img:hover,
#settings-icon img:hover {
  transform: scale(1.2);
}

/* Adjust colors based on theme */
body.light-theme #theme-toggle img,
body.light-theme #settings-icon img {
  filter: invert(0);
  /* Light theme icon remains normal */
}

body.dark-theme #theme-toggle img,
body.dark-theme #settings-icon img {
  filter: invert(0);
  /* Dark theme inverts the icon for better contrast */
}

/* Default Dark Theme */
body.dark-theme {
  background-color: #121212;
  color: #5daeff;
}

body.dark-theme header {
  background-color: #1e1e1e;
}

body.dark-theme #time-display {
  color: #76c7c0;
}

body.dark-theme button {
  background-color: #3a3a3a;
  color: #e0e0e0;
}

body.dark-theme button:hover {
  background-color: #ff8c00;
}

/* Light Theme (default) */
body.light-theme {
  background-color: #ffffff;
  color: #000000;
}

body.light-theme header {
  background-color: #f0f0f0;
}

body.light-theme #scramble,
body.light-theme #timer,
body.light-theme #controls,
body.light-theme #history,
body.light-theme #statistics {
  background-color: #f0f0f0;
  /* Matches the header background */
}

body.light-theme #time-display {
  color: #333333;
}

body.light-theme button {
  background-color: #e0e0e0;
  color: #000000;
}

body.light-theme button:hover {
  background-color: #ff8c00;
}

/* Button Animations */

button {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:active {
  transform: scale(0.95);
  /* Slightly shrink on click */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  /* Add a subtle shadow */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#scramble-text {
  animation: fadeIn 0.5s ease;
}

/* Separator */
#page-separator {
  margin: 2rem auto;
  width: 90%;
  max-width: 600px;
  border: none;
  height: 2px;
  background-color: #444; /* Dark gray for dark theme */
}

/* Theme Toggle Button */
#theme-toggle {
  margin: 0.5rem auto;
  padding: 0.7rem 1.5rem;
  border: none;
  background-color: #3a3a3a;
  color: #e0e0e0;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: inline-block;
}

#theme-toggle:hover {
  background-color: #ff8c00;
  transform: translateY(-3px);
}

/* Adjust colors for light theme */
body.light-theme #theme-toggle {
  background-color: #e0e0e0;
  color: #000000;
}

body.light-theme #theme-toggle:hover {
  background-color: #ff8c00;
}

/* Solve History Item Styles - Dark Theme */
body.dark-theme #solve-list li {
  background-color: #262626;
  color: #e0e0e0;
}

/* Solve History Item Styles - Light Theme */
body.light-theme #solve-list li {
  background-color: #f0f0f0; /* Matches light theme background */
  color: #000000; /* Dark text for light theme */
}

/* General Styles for Solve History Items */
#solve-list li {
  margin: 0.5rem 0;
  font-size: 1.2rem;
  padding: 0.7rem;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

#manual-solve {
  margin-top: 20px;
  text-align: center;
  padding: 1rem;
  background-color: #1e1e1e;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#manual-time {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 150px;
  margin-right: 10px;
}

#add-manual-time {
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  border: none;
  background-color: #3a3a3a;
  color: #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#add-manual-time:hover {
  background-color: #ff8c00;
  transform: translateY(-3px);
}

#add-manual-time:active {
  transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 1024px) {
  header h1 {
    font-size: 2rem;
  }

  #time-display {
    font-size: 3rem;
  }

  button {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
  }

  #scramble,
  #timer,
  #controls,
  #history,
  #statistics {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  #time-display {
    font-size: 2.5rem;
  }

  button {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }

  #scramble,
  #timer,
  #controls,
  #history,
  #statistics {
    padding: 0.8rem;
  }

  #settings-icon img {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.6rem;
  }

  #time-display {
    font-size: 2rem;
  }

  button {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
  }

  #scramble,
  #timer,
  #controls,
  #history,
  #download,
  #statistics {
    padding: 0.5rem;
  }

  #settings-icon img {
    width: 18px;
    height: 18px;
  }

  #solve-list {
    max-height: 300px;
    overflow-y: auto;
  }

  main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
  }

  hr {
    border: none;
    height: 2px;
    background-color: #ccc;
    margin: 20px 0;
  }

  /* Disable text selection */
  body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
  }

  /* Disable right-click (but allow interactions) */
  body {
    -webkit-touch-callout: none; /* Disable touch menu on mobile */
  }

  a {
    text-decoration: none; /* Removes underline */
    color: inherit; /* Uses the same color as normal text */
    cursor: pointer; /* Ensures it still acts like a link */
  }

  /* Login Container */
  /* Center the Login Container */
  .login-container {
    width: 300px;
    margin: 50px auto; /* Centers the box */
    padding: 20px;
    background: #1e1e1e;
    color: #5daeff;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers all child elements */
  }

  /* Style Input Fields */
  .login-container input {
    width: 90%; /* Slightly reduced width to avoid touching edges */
    padding: 10px;
    margin: 10px 0;
    border: none;
    border-radius: 5px;
    text-align: center; /* Center text inside the input */
  }

  /* Buttons */
  /* Center the Login Button */
  .login-container button {
    width: 90%; /* Match input field width */
    padding: 10px;
    background: #5daeff;
    color: #121212;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: block;
    margin: 10px auto; /* Center the button */
    text-align: center;
  }

  .login-container button:hover {
    background: #ffffff;
  }

  /* Social Login */
  .social-login {
    margin-top: 10px;
  }

  .google-login,
  .facebook-login {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  /* Center Google Login Image */
  #google-login {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    cursor: pointer;
  }

  /* Adjust Image Size */
  #google-login img {
    width: 200px; /* Adjust as needed */
    height: auto;
  }

  @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap");

  .gsi-material-button {
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-appearance: none;
    background-color: #f2f2f2;
    background-image: none;
    border: none;
    border-radius: 4px;
    box-sizing: border-box;
    color: #1f1f1f;
    cursor: pointer;
    font-family: "Roboto", arial, sans-serif;
    font-size: 14px;
    height: 40px;
    letter-spacing: 0.25px;
    outline: none;
    overflow: hidden;
    padding: 0 12px;
    position: relative;
    text-align: center;
    transition: background-color 0.218s, border-color 0.218s, box-shadow 0.218s;
    vertical-align: middle;
    white-space: nowrap;
    width: auto;
    max-width: 400px;
    min-width: min-content;
    display: flex;
    align-items: center;
  }

  .gsi-material-button .gsi-material-button-icon {
    height: 20px;
    margin-right: 12px;
    min-width: 20px;
    width: 20px;
  }

  .gsi-material-button .gsi-material-button-content-wrapper {
    align-items: center;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100%;
    justify-content: space-between;
    position: relative;
    width: 100%;
  }

  .gsi-material-button .gsi-material-button-contents {
    flex-grow: 1;
    font-family: "Roboto", arial, sans-serif;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
  }

  .gsi-material-button .gsi-material-button-state {
    transition: opacity 0.218s;
    bottom: 0;
    left: 0;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
  }

  .gsi-material-button:disabled {
    cursor: default;
    background-color: #ffffff61;
  }

  .gsi-material-button:disabled .gsi-material-button-state {
    background-color: #1f1f1f1f;
  }

  .gsi-material-button:disabled .gsi-material-button-contents {
    opacity: 38%;
  }

  .gsi-material-button:disabled .gsi-material-button-icon {
    opacity: 38%;
  }

  .gsi-material-button:not(:disabled):active .gsi-material-button-state,
  .gsi-material-button:not(:disabled):focus .gsi-material-button-state {
    background-color: #001d35;
    opacity: 12%;
  }

  .gsi-material-button:not(:disabled):hover {
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3),
      0 1px 3px 1px rgba(60, 64, 67, 0.15);
  }

  .gsi-material-button:not(:disabled):hover .gsi-material-button-state {
    background-color: #001d35;
    opacity: 8%;
  }

  .facebook-login {
    background: #3b5998;
    color: white;
  }

  @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap");

  .fb-material-button {
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-appearance: none;
    background-color: #1877f2;
    border: none;
    border-radius: 4px;
    box-sizing: border-box;
    color: #ffffff;
    cursor: pointer;
    font-family: "Roboto", arial, sans-serif;
    font-size: 14px;
    height: 40px;
    letter-spacing: 0.25px;
    outline: none;
    overflow: hidden;
    padding: 0 12px;
    position: relative;
    text-align: center;
    transition: background-color 0.218s, border-color 0.218s, box-shadow 0.218s;
    vertical-align: middle;
    white-space: nowrap;
    width: auto;
    max-width: 400px;
    min-width: min-content;
    display: flex;
    align-items: center;
  }

  .fb-material-button .fb-material-button-icon {
    height: 20px;
    margin-right: 12px;
    min-width: 20px;
    width: 20px;
  }

  .fb-material-button .fb-material-button-content-wrapper {
    align-items: center;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100%;
    justify-content: space-between;
    position: relative;
    width: 100%;
  }

  .fb-material-button .fb-material-button-contents {
    flex-grow: 1;
    font-family: "Roboto", arial, sans-serif;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
  }

  .fb-material-button .fb-material-button-state {
    transition: opacity 0.218s;
    bottom: 0;
    left: 0;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
  }

  .fb-material-button:disabled {
    cursor: default;
    background-color: #1877f280;
  }

  .fb-material-button:not(:disabled):hover {
    background-color: #165fce;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3),
      0 1px 3px 1px rgba(60, 64, 67, 0.15);
  }

  .fb-material-button:not(:disabled):hover .fb-material-button-state {
    opacity: 8%;
  }
}
