/* Base styles */
body {
  font-family: 'Montserrat', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center; /* This centers the content vertically */
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: #222;
  transition: background 0.6s ease, color 0.4s ease;
}

/* Light mode styles - The default theme */
.container {
  text-align: center;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  padding: 20px 40px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: background 0.5s ease, color 0.5s ease;
  margin-top: 0;
  max-width: 400px;
  width: 90%;
}

.button {
  display: block;
  margin: 15px 0;
  padding: 16px 24px;
  background: linear-gradient(135deg, #ececec, #d4d4d4);
  color: #222;
  text-decoration: none;
  border-radius: 12px;
  font-size: 1.1em;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.15);
}

.button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

/* --------------------------------------------------------------------- */

/* Dark mode styles - These apply automatically if the system prefers dark mode */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #141414, #1f1f2e);
    color: #e5e5e5;
  }
  
  .container {
    background: rgba(25, 25, 25, 0.7);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  }

  .button {
    background: linear-gradient(135deg, #333, #444);
    color: #f0f0f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  }

  .button:hover {
    box-shadow: 0 6px 20px rgba(120, 200, 255, 0.4);
  }
}

/* --------------------------------------------------------------------- */

/* Manual dark mode toggle - This class is applied via JavaScript for user-initiated dark mode */
body.dark-mode {
  background: linear-gradient(135deg, #141414, #1f1f2e);
  color: #e5e5e5;
}

body.dark-mode .container {
  background: rgba(25, 25, 25, 0.7);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

body.dark-mode .button {
  background: linear-gradient(135deg, #333, #444);
  color: #f0f0f0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

body.dark-mode .button:hover {
  box-shadow: 0 6px 20px rgba(120, 200, 255, 0.4);
}

/* --------------------------------------------------------------------- */

/* Top bar and toggle styles */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  padding: 20px;
  z-index: 100;
}

.toggle-container {
  display: flex;
  align-items: center;
}

#dark-mode-toggle {
  display: none;
}

.toggle-container label {
  background: #bbb;
  border-radius: 30px;
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: background 0.3s ease;
  width: 55px;
  height: 28px;
}

body.dark-mode .toggle-container label {
  background: #444;
}

.toggle-container .moon {
  background: #f1c40f;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  left: 4px;
  transition: transform 0.3s ease, background 0.3s ease;
  width: 20px;
  height: 20px;
}

#dark-mode-toggle:checked + label .moon {
  transform: translateX(27px);
  background: #9b59b6;
}

.toggle-container .star {
  color: #fff;
  font-size: 10px;
  line-height: 1;
  opacity: 0;
  position: absolute;
  top: 8px;
  transition: opacity 0.3s ease;
}

#dark-mode-toggle:checked + label .star {
  opacity: 1;
}

.toggle-container .star-1 {
  left: 8px;
  transform: rotate(-15deg);
}

.toggle-container .star-2 {
  left: 16px;
  transform: rotate(15deg);
}
