/* ==============================
   FLASHCARDS APP LESS STYLESHEET — v3.0
   ============================== */
/* === Variables === */
/* === BUTTON Mixins === */
.button-primary {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #007bff;
  color: #ffffff;
}
.button-primary:hover {
  transform: translateY(-1px);
}
.button-primary:hover {
  background: #005ecb;
}
.button-secondary {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #6c757d;
  color: #ffffff;
}
.button-secondary:hover {
  transform: translateY(-1px);
}
.button-secondary:hover {
  background: #5a6268;
}
.button-gray {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: gainsboro;
  color: gray;
}
.button-gray:hover {
  transform: translateY(-1px);
}
.button-gray:hover {
  background: #d0d0d0;
}
.button-active {
  box-shadow: 0 0 6px rgba(0, 123, 255, 0.5);
}
/* ==============================
   FLASHCARDS APP STYLESHEET â€” v3.0
   ============================== */
#app-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #808080;
  margin-block-start: 4px !important;
  margin-block-end: 4px !important;
}
/* --- Filters --- */
#filter-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  background: #f9f9f9;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  /* Filter inputs and selects */
  /* Filter buttons */
}
#filter-container select,
#filter-container input[type="text"] {
  padding: 6px 10px;
  border: 1px solid #cccccc;
  border-radius: 6px;
  background: #ffffff;
  color: #222222;
  font-size: 14px;
  min-width: 130px;
  max-width: 200px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}
#filter-container select:focus,
#filter-container input[type="text"]:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}
#filter-container select:hover,
#filter-container input[type="text"]:hover {
  border-color: #b3b3b3;
}
#filter-container button {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #007bff;
  color: #ffffff;
  height: 30px;
}
#filter-container button:hover {
  transform: translateY(-1px);
}
#filter-container button:hover {
  background: #005ecb;
}
#filter-container button:hover {
  transform: translateY(-1px);
}
#filter-container button:hover {
  background: #005ecb;
}
#filter-container #clear-filter-btn {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #6c757d;
  color: #ffffff;
  height: 30px;
  margin-left: auto;
}
#filter-container #clear-filter-btn:hover {
  transform: translateY(-1px);
}
#filter-container #clear-filter-btn:hover {
  background: #5a6268;
}
#filter-container #clear-filter-btn:hover {
  transform: translateY(-1px);
}
#filter-container #clear-filter-btn:hover {
  background: #5a6268;
}
/* --- Timer Section --- */
.timer-controls {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #333333;
  margin-top: 0;
  margin-bottom: 6px;
  white-space: nowrap;
}
.timer-controls .timer-delays {
  display: none;
  height: 24px;
}
.timer-controls .timer-delays input[type="number"] {
  width: 30px;
  padding: 3px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-left: 4px;
  text-align: center;
  font-size: 13px;
}
/* --- Timer Progress Bar --- */
.timer-progress-container {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-block-start: 4px;
  margin-bottom: 4px;
  position: relative;
  /* style the timer progress bar */
}
.timer-progress-container .timer-progress-bar,
.timer-progress-container div {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #007bff, #00c6ff);
  transition: width 0.04s linear;
}
.timer-progress-container.timer-active {
  transition: width 0.1s linear;
}
.timer-progress-container #pause-timer.button-primary {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #007bff;
  color: #ffffff;
}
.timer-progress-container #pause-timer.button-primary:hover {
  transform: translateY(-1px);
}
.timer-progress-container #pause-timer.button-primary:hover {
  background: #005ecb;
}
.timer-progress-container #pause-timer.button-primary:hover {
  transform: translateY(-1px);
}
.timer-progress-container #pause-timer.button-primary:hover {
  background: #005ecb;
}
.timer-progress-container #pause-timer.button-secondary {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #6c757d;
  color: #ffffff;
}
.timer-progress-container #pause-timer.button-secondary:hover {
  transform: translateY(-1px);
}
.timer-progress-container #pause-timer.button-secondary:hover {
  background: #5a6268;
}
.timer-progress-container #pause-timer.button-secondary:hover {
  transform: translateY(-1px);
}
.timer-progress-container #pause-timer.button-secondary:hover {
  background: #5a6268;
}
/* Green flash success animation */
/*
@keyframes flash-green {
  0%   { background-color: @edit-color; }       // pale yellow start (edit mode)
  20%  { background-color: @edit-save-flash; }  // bright green flash 
  80%  { background-color: @edit-save-flash; }
  100% { background-color: @edit-color; }       // return to edit yellow 
}
*/
/* --- Flashcard Display --- */
#flashcard {
  position: relative;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* --- Normally Hidden Question Data (anchored at bottom of flashcard) --- */
  /* Apply animation via class */
}
#flashcard .question {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}
#flashcard .tf-prefix {
  font-weight: bold;
  margin-right: 0.25em;
}
#flashcard .divider {
  border: none;
  border-top: 1px solid #ccc;
  margin: 8px 0;
  opacity: 0.6;
}
#flashcard .answer {
  line-height: 1.6;
  font-size: 15px;
  flex: 1;
}
#flashcard .question[contenteditable="true"],
#flashcard .answer[contenteditable="true"] {
  outline: none;
  border: none;
  box-shadow: none;
}
#flashcard .reference {
  font-size: 13px;
  color: #808080;
  margin-top: 8px;
}
#flashcard #meta-row {
  display: none;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  gap: 16px;
  padding: 6px 8px;
  border-top: 1px solid #ccc;
  font-size: 0.7em;
  background: #f9f9f9;
  color: #333333;
  opacity: 0;
  transition: opacity 0.25s ease;
  /* Anchoring to bottom */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  /* --- Label/value pairs --- */
  /* --- Visible (Ctrl+E) --- */
  /* --- Responsive (mobile) --- */
}
#flashcard #meta-row > div {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  color: #222;
}
#flashcard #meta-row > div span {
  font-weight: normal;
  color: black;
}
#flashcard #meta-row.visible {
  display: flex;
  opacity: 1;
}
@media (max-width: 600px) {
  #flashcard #meta-row {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    position: static;
    /* revert to flow for small screens */
    border-radius: 0;
  }
}
#flashcard.edit-mode {
  /* --- Always visible in edit mode --- */
  display: flex !important;
  opacity: 1;
  background: #fff8dc;
  border-color: #e0c97a;
}
#flashcard.edit-save-success {
  background-color: #e6ffe6;
}
/* --- Progress Bar --- */
.progress-bar {
  position: relative;
  height: 18px;
  background: #e9ecef;
  border-radius: 9px;
  margin: 4px 0 4px;
  overflow: hidden;
}
.progress-bar > .progress-bar-slider {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: #007bff;
  transition: width 0.3s ease;
  border-radius: 9px;
}
.progress-bar > .progress-bar-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  line-height: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: darkgray;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
/* --- Hidden Helper --- */
.hidden {
  display: none;
}
/* --- Controls --- */
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
  margin-top: 8px;
  margin-bottom: 8px;
  padding-top: 12px;
  border-top: 2px solid #eee;
  /* Navigation group */
  /* Navigation Buttons */
  /* Show Answer / Next (match filter height) */
  /* === Review Stars === */
}
.controls button {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #007bff;
  color: #ffffff;
}
.controls button:hover {
  transform: translateY(-1px);
}
.controls button:hover {
  background: #005ecb;
}
.controls button:hover {
  transform: translateY(-1px);
}
.controls button:hover {
  background: #005ecb;
}
.controls .nav-group {
  display: flex;
  gap: 8px;
}
.controls .nav-btn {
  width: 34px;
  transition: background 0.2s ease, transform 0.1s ease;
}
.controls .nav-btn:hover {
  background: #005ecb;
  transform: translateY(-1px);
}
.controls #question-index {
  width: 60px;
  text-align: center;
  margin: 0 10px;
}
.controls #question-index.q-and-a-mode {
  background-color: #ffd27f;
}
.controls #show-answer {
  width: 140px;
  font-weight: 600;
  background: linear-gradient(135deg, #0d6efd, #005ecb);
  transition: background 0.3s ease, transform 0.1s ease;
}
.controls #show-answer:hover {
  background: linear-gradient(135deg, #0b5ed7, #004bb5);
  transform: translateY(-1px);
}
.controls .review-star {
  width: 34px;
  font-size: 22px;
  color: #ccc;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.controls .review-star.gold-star {
  color: #ffd700 !important;
  /* ensure it overrides the gray */
}
.controls .review-star:hover {
  color: #ffe766;
}
.controls .review-btn {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #007bff;
  color: #ffffff;
}
.controls .review-btn:hover {
  transform: translateY(-1px);
}
.controls .review-btn:hover {
  background: #005ecb;
}
.controls .review-btn:hover {
  transform: translateY(-1px);
}
.controls .review-btn:hover {
  background: #005ecb;
}
.controls .edit-btn {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: gainsboro;
  color: gray;
}
.controls .edit-btn:hover {
  transform: translateY(-1px);
}
.controls .edit-btn:hover {
  background: #d0d0d0;
}
.controls .edit-btn:hover {
  transform: translateY(-1px);
}
.controls .edit-btn:hover {
  background: #d0d0d0;
}
.controls .edit-btn.danger {
  background: #b00020;
  color: white;
}
.controls .edit-btn.danger:hover {
  background: #4a000d;
}
.controls #edit-save-btn,
.controls #edit-cancel-btn,
.controls #edit-add-btn,
.controls #edit-delete-btn {
  display: none;
}
/* --- Responsive --- */
@media (max-width: 700px) {
  #filter-container,
  #timer-settings {
    flex-direction: column;
    align-items: stretch;
  }
  .controls {
    flex-direction: column;
  }
  #show-answer {
    width: 100%;
  }
  .nav-btn {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
}
/* --- Admin Buttons --- */
.admin-btn {
  border: none;
  border-radius: 6px;
  height: 34px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
  background: #6c757d;
  color: #ffffff;
  transition: background 0.2s ease;
}
.admin-btn:hover {
  transform: translateY(-1px);
}
.admin-btn:hover {
  background: #5a6268;
}
.admin-btn:hover {
  transform: translateY(-1px);
}
.admin-btn:hover {
  background: #5a6268;
}
.admin-btn:hover {
  background: #333;
}
/* -------------------------------
   ADMIN TABLE — COMPACT ROWS
   ------------------------------- */
/* Reduce row height and padding */
#flashcards-table-body {
  /* Narrow ALL inputs in admin table… */
  /* …except Question and Answer columns */
  /* Make Category / Subcat nicer but still compact */
  /* ID column very tight */
  /* OrigNo, QNo very tight */
  /* Save button smaller */
}
#flashcards-table-body tr {
  height: 28px;
}
#flashcards-table-body td {
  padding: 4px 6px;
  vertical-align: middle;
}
#flashcards-table-body input[type="text"],
#flashcards-table-body input[type="number"] {
  width: 80px !important;
  padding: 2px 4px;
  font-size: 12px;
}
#flashcards-table-body .question-cell textarea,
#flashcards-table-body .answer-cell textarea {
  width: 100% !important;
  min-width: 250px !important;
  /* keep healthy size */
  height: 60px;
  /* small but readable */
  font-size: 13px;
  padding: 4px 6px;
}
#flashcards-table-body .category-cell input,
#flashcards-table-body .subcategory-cell input {
  width: 100px !important;
}
#flashcards-table-body .id-cell input {
  width: 55px !important;
  text-align: center;
}
#flashcards-table-body .orig-no-cell input,
#flashcards-table-body .q-no-cell input {
  width: 60px !important;
  text-align: center;
}
#flashcards-table-body .save-flashcard {
  padding: 2px 8px;
  font-size: 11px;
}
