/* ---------------- Global ---------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: #0f172a;
  color: #f8fafc;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* change from flex-start to center */
}


/* ---------------- Links ---------------- */
a {
  text-decoration: none;
  color: inherit;
}

/* ---------------- Navbar ---------------- */
.navbar {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  position: fixed;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
}

.nav-left {
  flex: 1 1 auto;
}

.nav-logo {
  font-size: 1.8em;
  font-weight: bold;
  color: #e0e7ff;
  white-space: nowrap;
}

.nav-right {
  display: flex;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nav-right a, .nav-right span {
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.3s;
  white-space: nowrap;
}

.nav-right a:hover, .nav-link.active {
  background: #4f46e5;
  color: #fff;
}

.nav-username {
  font-weight: bold;
}

.nav-divider {
  color: #888;
  margin: 0 5px;
}

/* ---------------- Containers ---------------- */
.container {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(15px);
  padding: 50px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 720px;
  text-align: center;
  z-index: 5;
  overflow: auto; /* allows scroll if flashcards grow */
}


h1 {
  font-size: 2.8em;
  margin-bottom: 20px;
  color: #e0e7ff;
}

p {
  color: #cbd5e1;
  margin-bottom: 25px;
}


/* ---------------- Inputs & Buttons ---------------- */

textarea, input[type="text"], input[type="password"], .custom-file-btn, button {
  width: 100%;
  margin-top: 15px;
  padding: 18px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  outline: none;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

button {
  background: #4f46e5;
  color: white;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  transition: 0.3s;
}

button:hover {
  background: #4338ca;
}

/* ---------------- Flashcards ---------------- */
#flashcards {
  margin-top: 30px;
}

.card {
  background: rgba(255, 255, 255, 0.12);
  padding: 18px;
  border-radius: 14px;
  margin-bottom: 15px;
  transition: transform 0.2s;
}

.card:hover {
  transform: scale(1.03);
}

.flashcard {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  padding: 15px;
  margin: 10px 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ---------------- Auth Pages ---------------- */
.auth-container {
  max-width: 720px;
  margin: 140px auto;
  text-align: center;
}

.auth-container h2 {
  font-size: 2em;
  margin-bottom: 20px;
}

/* ---------------- Error Messages ---------------- */
.error-msg {
  color: #f87171;
  margin-top: 10px;
}

/* ---------------- Custom File Input ---------------- */
input[type="file"] {
  display: none;
}

.custom-file-btn {
  display: inline-block;
  cursor: pointer;
  background: #22c55e;
  color: #fff;
  font-weight: bold;
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  transition: 0.3s;
  margin-top: 15px;
}

.custom-file-btn:hover {
  background: #16a34a;
}

/* ---------------- Mobile ---------------- */
@media screen and (max-width: 600px) {
  .container {
    padding: 30px 20px;
  }

  textarea, input[type="text"], input[type="password"], .custom-file-btn, button {
    padding: 15px;
    font-size: 14px;
  }

  h1 {
    font-size: 2em;
  }

  .nav-right {
    justify-content: center;
    width: 100%;
    margin-top: 10px;
  }

  .navbar {
    padding: 10px 15px;
  }
}
