/* Global site styles */
* { box-sizing: border-box; margin:0; padding:0; }

body {
  font-family: Arial, sans-serif;
  display: flex;
  min-height: 100vh;
  background-color: #222;
  color: #fff;
}

/* --- Sidebar --- */
#sidebar {
  width: 220px;
  background-color: #111;
  padding-top: 60px;
  position: fixed;
  height: 100%;
  overflow-y: auto;
  transform: translateX(-100%); /* hidden by default */
  transition: transform 0.3s ease;
  z-index: 5;
}

#sidebar.active {
  transform: translateX(0); /* slide in */
}

#sidebar a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 12px 20px;
  transition: 0.3s;
}

#sidebar a:hover { background-color: #444; }
#sidebar a.active { background-color: #555; font-weight: bold; }
#sidebar a.logout { color: #f55; }

/* --- Main content area --- */
#content {
  margin-left: 220px;
  flex: 1;
  padding: 20px;
  transition: margin-left 0.3s ease;
}

/* Toggle button */
#toggleBtn {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  background:#222;
  color:#fff;
  border:none;
  cursor:pointer;
  padding:6px 10px;
  border-radius:4px;
}

/* Center content utility class */
.centered-container {
  display:flex;
  justify-content:center;
  align-items:center;
  min-height: 80vh;
  flex-direction: column;
}

/* --- Flashcard page overrides --- */
#flashcard {
  font-size: 1.8em;
  padding: 30px;
  border-radius: 12px;
  background-color: #333;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  margin-bottom: 20px;
  width: 90%;
  max-width: 600px;
  min-height: 150px;
  text-align: center;
  color: #fff;
  word-wrap: break-word;
}

/* Buttons */
button {
  padding: 10px 20px;
  font-size: 1.1em;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background-color: #0078d7;
  color: white;
  margin: 5px;
  transition: background-color 0.3s;
}

button:hover { background-color: #005fa3; }

/* Difficulty slider */
#difficultyContainer {
  margin: 15px 0;
  width: 90%;
  max-width: 600px;
  text-align: left;
  color: #fff;
}
#difficultyContainer label { margin-right:10px; color:#fff; }
#difficultyValue { font-weight:bold; color:#fff; }

/* --- Responsive adjustments --- */
@media (max-width: 600px){
  #flashcard { font-size:1.5em; padding:20px; }
  button { font-size:1em; padding:8px 16px; }
  #sidebar { width:180px; transform: translateX(-100%); }
  #content { margin-left:0; padding:15px; }
  
  /* Toggle button adjustments for mobile */
  #toggleBtn {
    top: 10px;
    left: 10px;
    padding:6px 10px;
  }
  
  /* When sidebar is active on mobile, push content */
  #sidebar.active + #content {
    margin-left: 180px;
  }
}
