/* =========================
   FLASHCARDS
========================= */

.flashcard-container {
  background: #11172d;
  border: 1px solid #252b4a;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
}

/* =========================
   TOOLBAR
========================= */

.flashcard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.flashcard-toolbar label {
  color: #9da5c5;
  margin-right: 8px;
}

#deckSelect {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #30385f;
  background: #0b1022;
  color: white;
}

#shuffleBtn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #252d55;
  color: white;
  cursor: pointer;
}

#shuffleBtn:hover {
  background: #37427a;
}

/* =========================
   FLASHCARD
========================= */

.flashcard {
  width: 100%;
  max-width: 700px;
  height: 350px;

  margin: 0 auto 25px;

  perspective: 1000px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;

  width: 100%;
  height: 100%;

  transition: transform 0.6s;

  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

/* Front and Back */

.flashcard-front,
.flashcard-back {
  position: absolute;

  width: 100%;
  height: 100%;

  border-radius: 15px;

  display: flex;
  flex-direction: column;

  justify-content: center;
  align-items: center;

  text-align: center;

  padding: 40px;

  backface-visibility: hidden;
}

.flashcard-front {
  background: #252d55;
}

.flashcard-back {
  background: #6674ff;

  transform: rotateY(180deg);
}

.flashcard h2 {
  max-width: 600px;

  line-height: 1.5;

  color: white;
}

.flashcard p {
  color: #b7bfdc;

  margin-top: 20px;
}

.card-label {
  font-size: 12px;

  letter-spacing: 2px;

  color: #b7bfdc;

  margin-bottom: 20px;
}

/* =========================
   NAVIGATION
========================= */

.card-navigation {
  display: flex;

  justify-content: center;

  align-items: center;

  gap: 30px;
}

.card-navigation button {
  padding: 10px 18px;

  border: none;

  border-radius: 8px;

  background: #252d55;

  color: white;

  cursor: pointer;
}

.card-navigation button:hover {
  background: #37427a;
}

#cardCounter {
  color: #9da5c5;

  font-weight: bold;
}

/* =========================
   MEMORY BUTTONS
========================= */

.memory-buttons {
  display: flex;

  justify-content: center;

  gap: 12px;

  margin-top: 20px;
}

.memory-buttons button {
  padding: 10px 20px;

  border: none;

  border-radius: 8px;

  color: white;

  cursor: pointer;
}

.memory-hard {
  background: #d94b4b;
}

.memory-good {
  background: #d69e2e;
}

.memory-easy {
  background: #3fa66b;
}

/* =========================
   CREATE FLASHCARD
========================= */

.add-flashcard {
  margin-bottom: 20px;
}

.flashcard-form {
  display: grid;

  gap: 10px;
}

.flashcard-form input,
.flashcard-form textarea {
  width: 100%;

  padding: 12px;

  border-radius: 8px;

  border: 1px solid #30385f;

  background: #0b1022;

  color: white;

  font-family: inherit;

  resize: vertical;
}

.flashcard-form textarea {
  min-height: 80px;
}

.flashcard-form input:focus,
.flashcard-form textarea:focus {
  outline: none;

  border-color: #6674ff;
}

#addCardBtn {
  padding: 12px;

  border: none;

  border-radius: 8px;

  background: #6674ff;

  color: white;

  cursor: pointer;
}

#addCardBtn:hover {
  background: #5362e5;
}

/* =========================
   STATISTICS
========================= */

.flashcard-stats {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 20px;
}

.flashcard-stats .dashboard-card {
  text-align: center;
}

/* =========================
   LIGHT MODE
========================= */

body.light-mode .flashcard-container {
  background: white;

  border-color: #dddddd;
}

body.light-mode #deckSelect {
  background: #f5f6fa;

  color: #2c3e50;

  border-color: #d5d9e5;
}

body.light-mode #shuffleBtn,
body.light-mode .card-navigation button {
  background: #e9edfa;

  color: #2c3e50;
}

body.light-mode .flashcard-front {
  background: #eef3ff;
}

body.light-mode .flashcard-front h2 {
  color: #2c3e50;
}

body.light-mode .flashcard-front p {
  color: #666b7d;
}

body.light-mode .flashcard-form input,
body.light-mode .flashcard-form textarea {
  background: #f5f6fa;

  color: #2c3e50;

  border-color: #d5d9e5;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 700px) {
  .flashcard {
    height: 300px;
  }

  .flashcard-toolbar {
    flex-direction: column;

    gap: 15px;

    align-items: stretch;
  }

  .memory-buttons {
    flex-wrap: wrap;
  }

  .flashcard-stats {
    grid-template-columns: 1fr;
  }
}
/* =========================
   GENERAL
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #080b18;
  color: white;
  min-height: 100vh;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;

  width: 240px;
  height: 100vh;

  padding: 25px 15px;

  background: #10152b;
  border-right: 1px solid #252b4a;
}

.sidebar h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar a {
  text-decoration: none;
  color: #b9bfd8;

  padding: 12px 15px;
  border-radius: 10px;

  transition: 0.3s;
}

.sidebar a:hover {
  background: #20284b;
  color: white;
  transform: translateX(5px);
}

/* =========================
   MAIN CONTENT
========================= */

.main-content {
  margin-left: 240px;
  padding: 30px;
}

/* =========================
   TOP BAR
========================= */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 35px;
}

.topbar h2 {
  font-size: 24px;
}

#darkModeBtn {
  border: none;
  background: #20284b;
  color: white;

  padding: 10px 14px;
  border-radius: 10px;

  cursor: pointer;
  font-size: 18px;
}

/* =========================
   WELCOME
========================= */

.welcome {
  margin-bottom: 30px;
}

.welcome h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.welcome p {
  color: #9da5c5;
}
/* =========================
   LIGHT MODE
========================= */

body.light-mode {
  background: #f2f4fa;
  color: #171a2b;
}

body.light-mode .sidebar {
  background: #ffffff;
  border-color: #dddddd;
}

body.light-mode .sidebar a {
  color: #555b72;
}

body.light-mode .sidebar a:hover {
  background: #e9ecf5;
  color: #171a2b;
}

body.light-mode .card {
  background: #ffffff;
}
body.light-mode .dashboard-card {
  background: #ffffff;
  border-color: #dddddd;
}

body.light-mode .card span,
body.light-mode .welcome p {
  color: #666b7d;
}
/* =========================
   GENERAL
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #080b18;
  color: white;
  min-height: 100vh;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;

  width: 240px;
  height: 100vh;

  padding: 25px 15px;

  background: #10152b;
  border-right: 1px solid #252b4a;
}

.sidebar h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar a {
  text-decoration: none;
  color: #b9bfd8;

  padding: 12px 15px;
  border-radius: 10px;

  transition: 0.3s;
}

.sidebar a:hover {
  background: #20284b;
  color: white;
  transform: translateX(5px);
}

/* =========================
   MAIN CONTENT
========================= */

.main-content {
  margin-left: 240px;
  padding: 30px;
}

/* =========================
   TOP BAR
========================= */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 35px;
}

.topbar h2 {
  font-size: 24px;
}

#darkModeBtn {
  border: none;
  background: #20284b;
  color: white;

  padding: 10px 14px;
  border-radius: 10px;

  cursor: pointer;
  font-size: 18px;
}

/* =========================
   WELCOME
========================= */

.welcome {
  margin-bottom: 30px;
}

.welcome h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.welcome p {
  color: #9da5c5;
}

/* =========================
   STAT CARDS
========================= */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;

  margin-bottom: 25px;
}

.card {
  background: #11172d;

  padding: 20px;

  border: 1px solid #252b4a;
  border-radius: 15px;

  transition: 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  border-color: #6674ff;
}

.card h3 {
  margin-bottom: 15px;
}

.card p {
  font-size: 30px;
  font-weight: bold;

  margin-bottom: 5px;
}

.card span {
  color: #8f97b5;
  font-size: 14px;
}

/* =========================
   DASHBOARD GRID
========================= */

.dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.dashboard-card {
  background: #11172d;

  padding: 25px;

  border: 1px solid #252b4a;
  border-radius: 15px;
}

.dashboard-card h2 {
  margin-bottom: 20px;
}

/* =========================
   LIGHT MODE
========================= */

body.light-mode {
  background: #f2f4fa;
  color: #171a2b;
}

body.light-mode .sidebar {
  background: #ffffff;
  border-color: #dddddd;
}

body.light-mode .sidebar a {
  color: #555b72;
}

body.light-mode .sidebar a:hover {
  background: #e9ecf5;
  color: #171a2b;
}

body.light-mode .card {
  background: #ffffff;
}
body.light-mode .dashboard-card {
  background: #ffffff;
  border-color: #dddddd;
}

body.light-mode .card span,
body.light-mode .welcome p {
  color: #666b7d;
}

/* =========================
   CALENDAR
========================= */

.calendar-container {
  background: #11172d;
  border: 1px solid #252b4a;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
}

/* Calendar Header */

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.calendar-header h2 {
  font-size: 24px;
}

.calendar-header button {
  border: none;
  background: #252d55;
  color: white;

  width: 40px;
  height: 40px;

  border-radius: 10px;
  cursor: pointer;

  font-size: 20px;
}

.calendar-header button:hover {
  background: #37427a;
}

/* Weekdays */

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays div {
  text-align: center;
  color: #8f97b5;
  font-weight: bold;
  padding: 10px;
}

/* Calendar Days */

.calendar-day {
  min-height: 90px;

  border: 1px solid #252b4a;

  padding: 10px;

  cursor: pointer;

  transition: 0.2s;
}

.calendar-day:hover {
  background: #1b2341;
}

.calendar-day.empty {
  cursor: default;
  background: transparent;
}

/* Today's Date */

.calendar-day.today {
  background: #252d55;
  border: 2px solid #6674ff;
}

.calendar-day.today .day-number {
  color: #8d98ff;
  font-weight: bold;
}

/* Day Number */

.day-number {
  font-size: 16px;
}

/* Events */

.calendar-event {
  background: #6674ff;
  color: white;

  padding: 4px 6px;

  border-radius: 5px;

  font-size: 12px;

  margin-top: 8px;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* =========================
   CALENDAR BOTTOM
========================= */

.calendar-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Event Inputs */

.calendar-bottom input {
  width: 100%;

  padding: 12px;

  margin-bottom: 10px;

  border: 1px solid #30385f;
  border-radius: 8px;

  background: #0b1022;
  color: white;
}

.calendar-bottom input:focus {
  outline: none;
  border-color: #6674ff;
}

/* Add Event Button */

#addEventBtn {
  border: none;

  padding: 12px 20px;

  border-radius: 8px;

  background: #6674ff;
  color: white;

  cursor: pointer;
}

#addEventBtn:hover {
  background: #5362e5;
}

/* Event List */

.event-item {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: #1a2140;

  padding: 12px;

  margin-bottom: 8px;

  border-radius: 8px;
}

.delete-event {
  border: none;
  background: transparent;

  color: #ff6b6b;

  cursor: pointer;
}

/* =========================
   LIGHT MODE
========================= */

body.light-mode .calendar-container {
  background: white;
  border-color: #dddddd;
}

body.light-mode .calendar-day {
  border-color: #dddddd;
}

body.light-mode .calendar-day:hover {
  background: #f1f3f8;
}

body.light-mode .calendar-day.today {
  background: #eef3ff;
}

body.light-mode .calendar-header button {
  background: #e9edfa;
  color: #2c3e50;
}

body.light-mode .calendar-bottom input {
  background: #f5f6fa;
  color: #2c3e50;
  border-color: #d5d9e5;
}

body.light-mode .event-item {
  background: #f1f3f8;
}

body.light-mode .calendar-weekdays div {
  color: #666b7d;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 700px) {
  .calendar-day {
    min-height: 60px;
    padding: 5px;
  }

  .calendar-bottom {
    grid-template-columns: 1fr;
  }

  .calendar-event {
    font-size: 10px;
  }
}

/* =========================
   UPCOMING EVENTS
========================= */

.upcoming-event {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: #1a2140;

  padding: 12px;
  margin-bottom: 8px;

  border-radius: 8px;
}

.upcoming-event strong {
  color: white;
}

.upcoming-event span {
  color: #9da5c5;
  font-size: 13px;
}

/* Light Mode */

body.light-mode .upcoming-event {
  background: #f1f3f8;
}

body.light-mode .upcoming-event strong {
  color: #2c3e50;
}

body.light-mode .upcoming-event span {
  color: #666b7d;
}

/* =========================
   FLASHCARD ACTIONS
========================= */

.card-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.delete-card-btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  background: #3a2030;
  color: #ff8a8a;
  cursor: pointer;
}

.delete-card-btn:hover {
  background: #53283c;
}

@media (max-width: 900px) {
  .sidebar {
    width: 190px;
  }

  .main-content {
    margin-left: 190px;
  }
}

@media (max-width: 700px) {
  body {
    overflow-x: hidden;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 18px 12px;
    border-right: 0;
    border-bottom: 1px solid #252b4a;
  }

  .sidebar h1 {
    margin-bottom: 14px;
    font-size: 21px;
  }

  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sidebar a {
    flex: 1 1 135px;
    padding: 10px;
    text-align: center;
  }

  .sidebar a:hover {
    transform: none;
  }

  .main-content {
    margin-left: 0;
    padding: 18px 14px 28px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 24px;
  }

  .topbar h2 {
    font-size: 20px;
  }

  .welcome h1 {
    font-size: 26px;
  }

  .flashcard-container,
  .dashboard-card {
    padding: 16px;
  }

  .flashcard {
    height: 280px;
  }

  .flashcard-front,
  .flashcard-back {
    padding: 22px 16px;
  }

  .flashcard h2 {
    font-size: 20px;
  }

  .card-navigation {
    gap: 8px;
  }

  .card-navigation button {
    flex: 1;
    min-height: 44px;
    padding: 10px 8px;
  }

  .memory-buttons button,
  #addCardBtn,
  .delete-card-btn {
    min-height: 44px;
  }
}
