/* Clean CSS file with no duplicates */
:root {
  font-family:"DotGothic16", sans-serif;
  box-sizing:border-box;
  --dark-pink:#fb8fa9;
  --light-pink:#fbc2c8;
  --darker-pink:#FF3D6A;
  --darkest-pink:#b02c4b;
  --bright-pink:#F00038;
  --lighter-pink:#F8B9C8;
  --lightest-pink:#F8D3DC;
  --dark-blue:#7684a2;
  --light-blue:#A4C8E1;
  --bright-blue:#215ba6;
  --light-green:#d1de7a;
  --green:#a5b538;
  --dark-green:#999217;
  --dark-turquoise:#187a5f;
  --yellow:#FFE48A;
  --dark-yellow:#d4a50d;
  --light-yellow:#fff2c7;
  --orange:#FEAA8B;
  --dark-orange:#d16c30;
  --lightest-purple:#f6d4ff;
  --light-purple:#d4a4e0;
  --purple-pink:#F891DC;
  --bright-purple:#DE94F5;
  --dark-purple:#A04B8C;
  --darkest-purple:#521835;
  --dark-lavender:#6e45b5;
}

/* Global Styles */
body {
  background-color:var(--light-yellow);
}

/* Header Styles */
header {
  background: rgb(248,211,220);
  background: linear-gradient(0deg, rgba(248,211,220,1) 0%, rgba(248,185,200,1) 51%, rgba(251,143,169,1) 100%);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  box-sizing: border-box;
}

h1 {
  color: var(--darkest-purple);
  margin: 0;
  font-family: "DotGothic16", sans-serif;
  font-weight: bold;
  font-style: normal;
  flex-shrink: 0;
}

/* Navigation Styles */
.top-nav {
  font-family: "DotGothic16", sans-serif;
  display: flex;
  align-items: center;
}

.top-nav ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 10px;
}

.top-nav li {
  list-style: none;
  display: inline-block;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
}

.top-nav li:hover {
  background-color: var(--lightest-pink);
  border: 2px solid var(--dark-pink);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.entries-btn, .vocab-btn, .kanji-btn, .syntax-btn, .homework-btn, .admin-btn, .login-btn, .conversations-btn, .scrapbook-btn, .nav-link {
  color: var(--darkest-purple);
  text-decoration: none;
  font-weight: bold;
  font-family: "DotGothic16", sans-serif;
  transition: color 0.3s ease;
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: inherit;
}

.entries-btn:hover, .vocab-btn:hover, .kanji-btn:hover, .syntax-btn:hover, 
.homework-btn:hover, .admin-btn:hover, .login-btn:hover, .conversations-btn:hover, .scrapbook-btn:hover, .nav-link:hover {
  color: var(--bright-pink);
}

.logout-btn {
  color: var(--darkest-purple);
  text-decoration: none;
  font-weight: bold;
  font-family: "DotGothic16", sans-serif;
  transition: color 0.3s ease;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  margin: 0;
}

.logout-btn:hover {
  color: var(--bright-pink);
}

.top-nav form {
  margin: 0;
  padding: 0;
  display: inline;
}

/* Main Content Layout */
.content {
  display: flex;
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  align-items: flex-start;
}

.entries-container {
  flex: 2;
  min-width: 0; 
}

.learning-sidebar {
  flex: 0 0 350px; 
  background: white;
  border-radius: 15px;
  border: 2px solid var(--light-pink);
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.learning-sidebar h3 {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 18px;
  text-align: center;
  margin: 0 0 20px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light-pink);
}

/* Learning Cards */
.learning-card {
  background: var(--lightest-pink);
  border-radius: 10px;
  border: 2px solid var(--dark-pink);
  padding: 15px;
  margin-bottom: 20px;
  position: relative;
  transition: all 0.3s ease;
}

.learning-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.learning-card h4 {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 16px;
  margin: 0 0 15px 0;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--dark-pink);
}

.refresh-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bright-purple);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.refresh-btn:hover {
  background: var(--dark-purple);
  transform: rotate(180deg);
}

/* Vocabulary Card Styles */
.vocab-card {
  border-color: var(--green);
}

.vocab-card h4 {
  color: var(--dark-green);
  border-bottom-color: var(--green);
}

.vocab-main {
  font-size: 20px;
  font-weight: bold;
  color: var(--darkest-purple);
  text-align: center;
  margin-bottom: 8px;
}

.vocab-reading {
  font-size: 16px;
  color: var(--dark-blue);
  text-align: center;
  margin-bottom: 6px;
  font-style: italic;
}

.vocab-meaning {
  font-size: 14px;
  color: var(--dark-green);
  text-align: center;
}

/* Kanji Card Styles */
.kanji-card {
  border-color: var(--dark-blue);
}

.kanji-card h4 {
  color: var(--dark-blue);
  border-bottom-color: var(--dark-blue);
}

.kanji-main {
  font-size: 32px;
  font-weight: bold;
  color: var(--darkest-purple);
  text-align: center;
  margin-bottom: 10px;
}

.kanji-reading {
  font-size: 14px;
  color: var(--dark-blue);
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.4;
}

.kanji-meaning {
  font-size: 14px;
  color: var(--dark-green);
  text-align: center;
  font-weight: bold;
}

/* Syntax Card Styles */
.syntax-card {
  border-color: var(--orange);
}

.syntax-card h4 {
  color: var(--dark-orange);
  border-bottom-color: var(--orange);
}

.syntax-main {
  font-size: 16px;
  font-weight: bold;
  color: var(--darkest-purple);
  text-align: center;
  margin-bottom: 8px;
  background: white;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid var(--orange);
}

.syntax-meaning {
  font-size: 14px;
  color: var(--darkest-purple);
  text-align: center;
  font-style: italic;
}

#random-vocab, #random-kanji, #random-syntax {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Card and Post Styles */
.card {
   background-color: white;
   margin-top: 10px;
}

.post{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:20px;
  max-width:100%;
  min-width:auto;
  margin-bottom: 20px;
  box-sizing:border-box;
}

.japanese-date {
  background: var(--light-green);
  border-radius: 20px;
  padding: 15px;
  align-self: center;
  font-size: 16px;
  font-weight: bold;
  color: var(--darkest-purple);
  text-align: center;
  min-width: 200px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--dark-green);
  margin-bottom: 15px;
}

/* Syntax Helper Styles */
.syntax-block{
  display: flex;
  justify-content:center;
  align-items:center;
  align-self:center;
  position:relative;
}

#syntax-text{
  background:var(--orange);
  border-radius:20px;
  padding:15px;
}


.syntax-helper {
  margin-top: 20px;
  padding: 20px;
  background: var(--lightest-pink);
  border-radius: 10px;
  border: 2px solid var(--dark-pink);
}

.syntax-helper h3 {
  color: var(--darkest-purple);
  margin-top: 0;
  text-align: center;
}

.syntax-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 15px 0;
  gap: 15px;
}

.syntax-display {
  flex: 1;
  text-align: center;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--light-pink);
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.syntax-display p {
  margin: 0;
  line-height: 1.5;
}

.syntax-display small {
  color: var(--dark-blue);
  margin-top: 10px;
  font-weight: bold;
}

/* Button Styles */
.nav-btn, .insert-btn, .close-btn, .syntax-helper-btn {
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: "DotGothic16", sans-serif;
  font-weight: bold;
  transition: background-color 0.3s;
}

.nav-btn {
  background: var(--dark-blue);
  color: white;
  min-width: 100px;
}

.nav-btn:hover {
  background: var(--darker-pink);
}

.syntax-helper-btn {
  background: var(--purple-pink);
  color: var(--darkest-purple);
}

.syntax-helper-btn:hover {
  background: var(--bright-purple);
}

.syntax-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.insert-btn {
  background: var(--light-green);
  color: var(--darkest-purple);
}

.insert-btn:hover {
  background: var(--yellow);
}

.close-btn {
  background: var(--orange);
  color: white;
}

.close-btn:hover {
  background: var(--bright-pink);
}

.button-group {
   display: none;
}

/* Admin Form Styles */
.admin-section {
  margin: 20px 0;
  padding: 20px;
  background: white;
  border-radius: 10px;
  border: 2px solid var(--light-pink);
}

.form-section {
  display: grid;
  grid-template-columns: 200px 1fr 300px;
  gap: 30px;
  align-items: start;
  max-width: 100%;
  margin: 0 auto 30px auto;
  background: white;
  padding: 25px;
  border-radius: 15px;
  border: 2px solid var(--light-pink);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  min-height:400px;
  box-sizing:border-box;
}

.helper-buttons-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 200px;
}

.helper-buttons-column h4 {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  text-align: center;
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--light-pink);
}

.form-content-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
  overflow: visible;
}

.form-content-column h3 {
  color: var(--darkest-purple);
  margin: 0 0 20px 0;
  text-align: center;
  font-family: "DotGothic16", sans-serif;
  font-size: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light-pink);
  flex-shrink: 0;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
  min-width: 0;
  position:relative;
  z-index:1;
}
.form-content-column,
.helper-buttons-column,
.helper-content-column {
  overflow: visible;
  word-wrap: break-word;
}
.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.form-row .form-group {
  flex: 1;
  min-width: 200px; /* Minimum width for form fields */
}

/* Input and textarea styling */
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--light-pink);
  border-radius: 8px;
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  background: var(--lightest-pink);
  transition: all 0.3s ease;
  box-sizing: border-box;
  min-height: 44px; 
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--bright-purple);
  box-shadow: 0 0 0 3px rgba(222, 148, 245, 0.1);
  background: white;
}
.form-section.simple-layout {
  display: block;
  max-width: 800px;
  background: linear-gradient(135deg, white, var(--lightest-pink));
  border: 3px solid var(--light-pink);
  position: relative;
  overflow: hidden;
}
.form-section.simple-layout::before {
  content: "✧ ♡ ✧";
  position: absolute;
  top: 10px;
  right: 20px;
  color: var(--bright-purple);
  font-size: 16px;
  opacity: 0.6;
}
.form-section.simple-layout h3 {
  text-align: center;
  color: var(--darkest-purple);
  background: linear-gradient(135deg, var(--light-pink), var(--lightest-pink));
  margin: -25px -25px 25px -25px;
  padding: 20px;
  border-bottom: 3px solid var(--dark-pink);
  position: relative;
}
.form-section.simple-layout h3::before {
  content: "💬";
  margin-right: 8px;
}
.form-section.simple-layout h3::after {
  content: "💭";
  margin-left: 8px;
}
.helper-content-column {
  background: var(--lightest-pink);
  border-radius: 10px;
  padding: 15px;
  border: 2px solid var(--light-pink);
  min-height: 300px;
  position: sticky;
  top: 20px;
  min-width: 250px;
  max-height: 500px;
  overflow-y: auto;
}
.helper-content-column h4 {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  text-align: center;
  margin: 0 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--dark-pink);
}

.helper-content-placeholder {
  text-align: center;
  color: var(--dark-purple);
  font-style: italic;
  padding: 20px;
  font-size: 14px;
}

.textarea-submit-container {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
/* Checkbox styling */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: normal !important;
  margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
  width: auto !important;
  margin: 0;
  cursor: pointer;
}
.helper-btn {
  background: var(--bright-purple);
  color: white;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: "DotGothic16", sans-serif;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 100%;
}

.helper-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.kanji-helper-btn {
  background: var(--dark-blue);
}

.kanji-helper-btn:hover {
  background: var(--light-blue);
}

.vocab-helper-btn {
  background: var(--green);
}

.vocab-helper-btn:hover {
  background: var(--dark-green);
}

.kaomoji-helper-btn {
  background: var(--bright-pink);
}

.kaomoji-helper-btn:hover {
  background: var(--darker-pink);
}

.form-content-column .form-group textarea[name="entryContent"] {
  min-height: 250px;
  resize: vertical;
  width: 100%;
  background:var(--lightest-pink);
  border: 2px solid var(--light-pink);
  border-radius: 8px;
  padding: 10px;
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
}

.form-content-column .submit-btn,
.submit-btn {
  background: var(--bright-purple);
  color: white;
  border: none;
  padding: 15px 25px;
  border-radius: 8px;
  font-family: "DotGothic16", sans-serif;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 20px;
  min-height: 50px;
}
.submit-btn:hover {
  background: var(--dark-purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.helper-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
  animation: fadeIn 0.3s ease-out;
}

.helper-section .helper-header {
  display: none;
}

/* Media Display Styles */
.entry-media {
  margin: 15px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.media-item {
  max-width: 300px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background: white;
  border: 2px solid var(--light-pink);
}
/* Media item hover effects */
.media-item img,
.scrapbook-image img {
  transition: all 0.3s ease;
  cursor: pointer;
}

.media-item img:hover,
.scrapbook-image img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  opacity: 0.95;
}
.media-item.image-item img {
  width: 100%;
  height: auto;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
}

.media-item.image-item img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.media-item.video-item video {
  width: 100%;
  height: auto;
  max-height: 200px;
}

.media-item.audio-item {
  padding: 10px;
  text-align: center;
}

.media-item.audio-item audio {
  width: 100%;
  margin-bottom: 8px;
}

.audio-filename {
  padding: 8px;
  background: var(--lightest-pink);
  font-size: 12px;
  text-align: center;
  color: var(--darkest-purple);
  border-top: 1px solid var(--light-pink);
}

.file-item {
  padding: 15px;
  background: var(--lightest-pink);
  border: 2px solid var(--light-pink);
  border-radius: 8px;
  text-align: center;
}

.file-item a {
  text-decoration: none;
  color: var(--bright-purple);
  font-weight: bold;
  transition: color 0.3s ease;
}

.file-item a:hover {
  color: var(--dark-purple);
}

/* Modal Styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  position: relative;
  text-align: center;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-content img,
.modal-content video {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  background: white;
  padding: 5px;
}

/* For very wide images */
.modal-content img.wide-image {
  max-width: 90vw;
  max-height: 70vh;
}

/* For very tall images */
.modal-content img.tall-image {
  max-width: 60vw;
  max-height: 85vh;
}


.close {
  position: absolute;
  top: -60px;
  right: -10px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 2px solid rgba(255,255,255,0.3);
}

.close:hover {
  background: var(--bright-pink);
  transform: scale(1.1);
  border-color: white;
}


/* Main Content Styles */
.main-content {
  flex: 1;
  border-radius: 15px;
  border: 2px solid var(--light-pink);
  padding: 25px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  background: linear-gradient(45deg, 
    rgba(255, 242, 199, 0.7),  /* var(--light-yellow) with 70% opacity */
    rgba(254, 170, 139, 0.7),  /* var(--orange) with 70% opacity */
     rgba(254, 170, 139, 0.7),  /* var(--orange) with 70% opacity */
    rgba(255, 228, 138, 0.7)   /* var(--yellow) with 70% opacity */
  );
  
}

.main-content::after {
  content: "✧ ◕ ‿ ◕ ✧";
  position: absolute;
  top: 8px;
  right: 15px;
  color: var(--dark-lavender);
  font-size: 12px;
  
  pointer-events: none;
}

.main-content h2 {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 24px;
  text-align: center;
  margin: 0 0 25px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light-pink);
}

/* Form Styles */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 5px;
  display: block;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px;
  border: 2px solid var(--light-pink);
  border-radius: 8px;
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  background: var(--lightest-pink);
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--bright-purple);
  background: white;
}
.form-group textarea {
  min-height: 100px;
  resize: vertical;
  font-family: "DotGothic16", sans-serif;
  line-height: 1.5;
}
/* Large content textarea */
.form-content-column .form-group textarea[name="entryContent"],
.form-content-column textarea#entryContent {
  min-height: 200px !important;
  resize: vertical;
  width: 100%;
  background: var(--lightest-pink);
  border: 2px solid var(--light-pink);
  border-radius: 8px;
  padding: 15px;
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  box-sizing: border-box;
}
/* Filter and Sort Styles */
.filter-sort-section {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 25px;
  padding: 15px;
  background: var(--lightest-pink);
  border-radius: 10px;
  border: 2px solid var(--light-pink);
  flex-wrap: wrap;
}

.filter-controls,
.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-controls label,
.sort-controls label {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-weight: bold;
  font-size: 14px;
  white-space: nowrap;
}

.filter-controls select,
.sort-controls select {
  padding: 8px 12px;
  border: 2px solid var(--light-pink);
  border-radius: 6px;
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

/* Table Styles */
.table-container {
  overflow-x: auto;
  border-radius: 10px;
  border: 2px solid var(--light-pink);
  background: white;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "DotGothic16", sans-serif;
}

.data-table th {
  background: linear-gradient(135deg, var(--light-pink), var(--lightest-pink));
  color: var(--darkest-purple);
  padding: 18px 15px;
  text-align: center;
  font-weight: bold;
  border-bottom: 3px solid var(--dark-pink);
  position: relative;
  font-size: 14px;
}
.data-table th::after {
  content: "♡";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bright-purple);
  font-size: 12px;
  opacity: 0.7;
}
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--light-pink);
  vertical-align: top;
}

.data-table tr:nth-child(even) {
  background: var(--light-yellow);
}

.data-table tr:hover {
  background: linear-gradient(135deg, var(--lightest-pink), rgba(255, 255, 255, 0.9));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(251, 143, 169, 0.2);
  transition: all 0.3s ease;
}
.data-table tr:hover .conversation-japanese,
.data-table tr:hover .conversation-english {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
/* Japanese Text Styles */
.romaji-text,
.kana-text,
.kanji-text {
  font-family: "DotGothic16", sans-serif;
  font-size: 16px;
  font-weight: bold;
}

.kana-text,
.kanji-text {
  color: var(--darkest-purple);
}

/* Class Badge Styles */
.class-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  color: white;
}

.class-noun { background: var(--green); }
.class-verb { background: var(--bright-purple); }
.class-adjective { background: var(--orange); }
.class-adverb { background: var(--dark-blue); }
.class-preposition { background: var(--dark-pink); }
.class-particle { background: var(--dark-purple); }

.no-class {
  color: var(--dark-purple);
  font-style: italic;
  font-size: 12px;
}

/* Category Cell Styles */
.category-cell {
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  font-weight: bold;
  color: var(--darkest-purple);
}

/* Action Button Styles */
.actions-cell {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.edit-btn,
.delete-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 5px;
  font-family: "DotGothic16", sans-serif;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.edit-btn {
  background: var(--light-blue);
  color: var(--darkest-purple);
}

.edit-btn:hover {
  background: var(--dark-blue);
  color: white;
}

.delete-btn {
  background: var(--dark-purple);
  color: white;
}

.delete-btn:hover {
  background: var(--darker-pink);
}

/* No Data Style */
.no-data {
  text-align: center;
  color: var(--dark-purple);
  font-style: italic;
  padding: 20px;
}


/* Homework-specific styles */
.homework-list {
  margin-top: 30px;
}

.homework-header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.homework-header-section h3 {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 20px;
  margin: 0;
}

.filter-sort-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px 15px;
  background: var(--lightest-pink);
  border-radius: 8px;
  border: 1px solid var(--light-pink);
}

.entry-count {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-weight: bold;
}
.entry-content,
#syntax-text {
  white-space: pre-line; 
  line-height: 1.6;
}

.syntax-block {
  white-space: pre-line;
  line-height: 1.6;
}
.filter-badge {
  background: var(--bright-purple);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: 8px;
}

.clear-filter-btn {
  background: var(--orange);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  font-family: "DotGothic16", sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.clear-filter-btn:hover {
  background: var(--dark-orange);
}

.homework-item {
  background: white;
  border: 2px solid var(--light-pink);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.homework-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--light-pink);
}

.homework-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.homework-date,
.homework-page,
.homework-question {
  background: var(--light-green);
  color: var(--darkest-purple);
  padding: 4px 8px;
  border-radius: 12px;
  font-family: "DotGothic16", sans-serif;
  font-size: 12px;
  font-weight: bold;
}

.homework-subject {
  background: var(--bright-purple);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-family: "DotGothic16", sans-serif;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.homework-subject:hover {
  background: var(--dark-purple);
}

.homework-actions {
  display: flex;
  gap: 8px;
}

.homework-question-text,
.homework-answer,
.homework-translation,
.homework-notes {
  margin-bottom: 15px;
  line-height: 1.6;
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
}

.homework-timestamps {
  color: var(--dark-purple);
  font-size: 12px;
  font-style: italic;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid var(--light-pink);
}

.no-entries {
  text-align: center;
  color: var(--dark-purple);
  font-style: italic;
  padding: 40px 20px;
  background: var(--lightest-pink);
  border-radius: 10px;
  border: 2px solid var(--light-pink);
}

/* Edit Modal Styles */
.edit-modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
}
#editModal {
  display: none;
}
#editModal.show {
  display: flex !important;
}
.edit-modal-content {
  background: white;
  border-radius: 15px;
  border: 2px solid var(--light-pink);
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  color: var(--dark-purple);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--bright-pink);
}

.edit-form-group {
  margin-bottom: 20px;
}

.edit-form-group label {
  display: block;
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-weight: bold;
  margin-bottom: 8px;
}

.edit-form-group input,
.edit-form-group select,
.edit-form-group textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--light-pink);
  border-radius: 8px;
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  background: var(--lightest-pink);
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.edit-form-group input:focus,
.edit-form-group select:focus,
.edit-form-group textarea:focus {
  outline: none;
  border-color: var(--bright-purple);
  background: white;
}

.edit-buttons {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 25px;
}

.edit-btn-save,
.edit-btn-cancel {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-family: "DotGothic16", sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.edit-btn-save {
  background: var(--bright-purple);
  color: white;
}

.edit-btn-save:hover {
  background: var(--dark-purple);
}

.edit-btn-cancel {
  background: var(--orange);
  color: white;
}

.edit-btn-cancel:hover {
  background: var(--dark-orange);
}

/* Conversations-specific styles */
.conversation-subject {
  text-align: center;
  padding:8px;
}

.subject-badge {
  background: linear-gradient(45deg, var(--bright-purple), var(--purple-pink));
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-family: "DotGothic16", sans-serif;
  font-size: 13px;
  font-weight: bold;
  display: inline-block;
  box-shadow: 0 3px 8px rgba(222, 148, 245, 0.4);
  border: 2px solid var(--light-pink);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}
.subject-badge::before {
  content: "✧";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.8;
}
.subject-badge::after {
  content: "✧";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.8;
}
.subject-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(222, 148, 245, 0.6);
  background: linear-gradient(45deg, var(--purple-pink), var(--bright-purple));
}
.no-subject {
  color: var(--dark-purple);
  font-style: italic;
  font-size: 12px;
  background: var(--lightest-pink);
  padding: 6px 12px;
  border-radius: 15px;
  border: 2px dashed var(--light-pink);
  display: inline-block;
}
.no-subject::before {
  content: "( ˘ ³˘) ";
  opacity: 0.7;
}
.conversation-japanese,
.conversation-english {
  padding: 15px;
  background: linear-gradient(135deg, var(--lightest-pink), white);
  border-radius: 12px;
  margin: 8px;
  border: 2px solid var(--light-pink);
  position: relative;
}
.conversation-japanese::before {
  content: "♡ 🇯🇵 ♡";
  position: absolute;
  top: -8px;
  left: 10px;
  background: var(--light-yellow);
  padding: 4px 8px;
  border-radius: 50px;
  font-size: 12px;
  border: 2px solid var(--orange);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.conversation-english::before {
  content: "♡ 🇦🇺 ♡";
  position: absolute;
  top: -8px;
  left: 10px;
  background: var(--light-blue);
  padding: 4px 8px;
  border-radius: 50px;
  font-size: 12px;
  border: 2px solid var(--dark-blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.dialogue-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 15px;
}

.dialogue-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 20px;
  line-height: 1.6;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.dialogue-line:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.dialogue-line.speaker-1 {
  background: linear-gradient(135deg, var(--lightest-pink), var(--light-pink));
  border-left: 5px solid var(--bright-purple);
  border-right: 3px solid var(--purple-pink);
}
.dialogue-line.speaker-1::before {
  content: "✧";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bright-purple);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.dialogue-line.speaker-2 {
  background: linear-gradient(135deg, var(--light-yellow), var(--yellow));
  border-left: 5px solid var(--orange);
  border-right: 3px solid var(--dark-orange);
}
.dialogue-line.speaker-2::before {
  content: "♡";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--orange);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.speaker-label {
  font-weight: bold;
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 12px;
  min-width: 80px;
  text-align: center;
  background: white;
  padding: 4px 8px;
  border-radius: 12px;
  border: 2px solid var(--light-pink);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  flex-shrink: 0;
}
.speaker-label::after {
  content: ":";
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bright-purple);
  font-weight: bold;
}
.dialogue-text {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  flex: 1;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 12px;
  border-radius: 15px;
  border: 1px solid rgba(251, 194, 200, 0.5);
  backdrop-filter: blur(5px);
}

.form-help {
  color: var(--dark-purple);
  font-style: italic;
  font-size: 12px;
  margin-top: 6px;
  text-align: center;
  background: var(--lightest-pink);
  padding: 6px 12px;
  border-radius: 15px;
  border: 1px solid var(--light-pink);
}

.form-help::before {
  content: "✧(◕‿-)✧ ";
}


/* Scrapbook-specific styles */
.scrapbook-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.scrapbook-entry {
   background: white;
  border: 2px solid var(--light-pink);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.scrapbook-entry:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.scrapbook-header {
  background: var(--lightest-pink);
  padding: 15px 20px;
  border-bottom: 2px solid var(--light-pink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scrapbook-title {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 18px;
  margin: 0;
  flex: 1;
}

.scrapbook-date {
  color: var(--dark-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 12px;
  background: var(--light-green);
  padding: 4px 8px;
  border-radius: 8px;
  margin-left: 10px;
}

.scrapbook-image {
  text-align: center;
  background: var(--lightest-pink);
}

.scrapbook-image img {
  max-width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  cursor: pointer;
  transition: all 0.3s ease;
}

.scrapbook-image img:hover {
  transform: scale(1.02);
}

.scrapbook-content {
  padding: 20px;
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  line-height: 1.6;
  flex: 1;
}

.scrapbook-content p {
  margin: 0;
}

.scrapbook-actions {
  padding: 15px 20px;
  border-top: 1px solid var(--light-pink);
  background: var(--light-yellow);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: auto;
}

.file-info {
  color: var(--dark-purple);
  font-size: 12px;
  font-style: italic;
  margin-top: 4px;
}

.current-image-info {
  color: var(--dark-purple);
  font-size: 12px;
  margin-top: 8px;
  padding: 8px;
  background: var(--lightest-pink);
  border-radius: 4px;
}

/* Image Modal Styles */
.image-modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.image-modal-content {
  position: relative;
  text-align: center;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  background: white;
  padding: 5px;
}
/* For very wide images */
.image-modal-content img.wide-image {
  max-width: 90vw;
  max-height: 70vh;
}

/* For very tall images */
.image-modal-content img.tall-image {
  max-width: 60vw;
  max-height: 85vh;
}
.edit-modal.show,
.image-modal.show {
  display: flex !important;
}
.close-image-modal {
  position: absolute;
  top: -50px;
  right: 0;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-image-modal:hover {
  background: var(--bright-pink);
  transform: scale(1.1);
}

.modal-image-title {
  color: white;
  font-family: "DotGothic16", sans-serif;
  font-size: 18px;
  margin-top: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  max-width: 90vw;
  word-wrap: break-word;
}

.speech-controls {
  padding: 10px 20px;
  border-top: 1px solid var(--light-pink);
  background: var(--lightest-pink);
  text-align: center;
}



/* Pagination Styles */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 30px 0;
  padding: 20px;
  background: white;
  border-radius: 10px;
  border: 2px solid var(--light-pink);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination-info {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  text-align: center;
  margin-bottom: 10px;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-btn,
.pagination-link {
  padding: 8px 12px;
  border: 2px solid var(--light-pink);
  border-radius: 6px;
  background: white;
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 40px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover,
.pagination-link:hover {
  background: var(--lightest-pink);
  border-color: var(--bright-purple);
  transform: translateY(-2px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pagination-btn:disabled:hover {
  background: white;
  border-color: var(--light-pink);
  transform: none;
}

.pagination-current {
  background: var(--bright-purple);
  color: white;
  border-color: var(--dark-purple);
}

.pagination-current:hover {
  background: var(--dark-purple);
  transform: none;
}

.pagination-ellipsis {
  padding: 8px 12px;
  color: var(--dark-purple);
  font-family: "DotGothic16", sans-serif;
  font-weight: bold;
}

.items-per-page {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.items-per-page label {
  color: var(--darkest-purple);
  font-family: "DotGothic16", sans-serif;
  font-weight: bold;
  font-size: 14px;
}

.items-per-page select {
  padding: 6px 10px;
  border: 2px solid var(--light-pink);
  border-radius: 5px;
  font-family: "DotGothic16", sans-serif;
  font-size: 14px;
  background: white;
  color: var(--darkest-purple);
  cursor: pointer;
}

.items-per-page select:focus {
  outline: none;
  border-color: var(--bright-purple);
}


/* Search functionality styles */
.search-group {
  flex: 2;
  min-width: 250px;
}

.search-container {
  display: flex;
  gap: 5px;
  align-items: center;
}

.search-container input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.search-btn, .clear-search-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.search-btn {
  background-color: #007bff;
  color: white;
}

.search-btn:hover {
  background-color: #0056b3;
}

.clear-search-btn {
  background-color: var(--darkest-pink);
  color: white;
}

.clear-search-btn:hover {
  background-color: var(--darker-pink);
}

.clear-filters-btn {
  padding: 8px 16px;
  background-color: var(--dark-yellow);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
  font-family:inherit;
}

.clear-filters-btn:hover {
  background-color: var(--dark-orange);
}

.search-results-info {
  margin: 15px 0;
  padding: 10px;
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  border-radius: 4px;
  color: #0c5460;
}

.search-results-info strong {
  font-weight: bold;
}

/* Quiz Styles */
.quiz-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.quiz-setup-form {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
}

.quiz-form-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

.quiz-form-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.quiz-form-group label {
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.quiz-form-group select {
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.start-quiz-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  transition: transform 0.2s;
}

.start-quiz-btn:hover {
  transform: translateY(-2px);
}

/* Loading spinner */
.loading-spinner {
  text-align: center;
  padding: 50px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Quiz header */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 25px;
  font-weight: bold;
}

.quiz-progress {
  color: #667eea;
  font-size: 18px;
}

.quiz-score {
  color: #28a745;
  font-size: 18px;
}

.quiz-timer {
  color: #fd7e14;
  font-size: 18px;
}

/* Question container */
.question-container {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.question-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.question-type {
  background: #667eea;
  color: white;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.question-category {
  background: #6c757d;
  color: white;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 12px;
}

.question-text {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin: 25px 0;
  color: #333;
  line-height: 1.4;
}

/* Choices */
.choices-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 25px 0;
}

.choice-btn {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 15px 20px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice-btn:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-2px);
}

.choice-btn.selected {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

.choice-btn.correct {
  border-color: #28a745;
  background: #28a745;
  color: white;
}

.choice-btn.incorrect {
  border-color: #dc3545;
  background: #dc3545;
  color: white;
}

.choice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

/* Question controls */
.question-controls {
  text-align: center;
  margin-top: 25px;
}

.submit-answer-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.submit-answer-btn:hover:not(:disabled) {
  background: #218838;
}

.submit-answer-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

/* Answer feedback */
.answer-feedback {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin: 15px 0;
  padding: 10px;
  border-radius: 6px;
}

.answer-feedback.correct {
  color: #28a745;
  background: #d4edda;
  border: 1px solid #c3e6cb;
}

.answer-feedback.incorrect {
  color: #721c24;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
}

/* Results */
.results-container {
  text-align: center;
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  font-size: 36px;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.results-stats {
  display: flex;
  justify-content: space-around;
  margin: 30px 0;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  margin: 10px;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 5px;
}

.results-feedback {
  font-size: 18px;
  font-weight: bold;
  margin: 25px 0;
  padding: 15px;
  border-radius: 8px;
}

.results-feedback.excellent {
  background: #d4edda;
  color: #155724;
}

.results-feedback.good {
  background: #cce5ff;
  color: #004085;
}

.results-feedback.okay {
  background: #fff3cd;
  color: #856404;
}

.results-feedback.needs-work {
  background: #f8d7da;
  color: #721c24;
}

.results-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.review-btn, .restart-btn, .back-btn {
  padding: 12px 25px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.review-btn {
  background: #007bff;
  color: white;
}

.review-btn:hover {
  background: #0056b3;
}

.restart-btn {
  background: #28a745;
  color: white;
}

.restart-btn:hover {
  background: #218838;
}

.back-btn {
  background: #6c757d;
  color: white;
}

.back-btn:hover {
  background: #545b62;
}

/* Answer review */
.review-item {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  margin: 15px 0;
  padding: 20px;
  text-align: left;
}

.review-item.correct {
  border-color: #28a745;
  background: #f8fff9;
}

.review-item.incorrect {
  border-color: #dc3545;
  background: #fff8f8;
}

.review-question-number {
  font-weight: bold;
  color: #667eea;
  margin-bottom: 10px;
}

.review-question {
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: bold;
}

.review-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-user-answer span.correct {
  color: #28a745;
  font-weight: bold;
}

.review-user-answer span.incorrect {
  color: #dc3545;
  font-weight: bold;
}

.review-correct-answer span.correct {
  color: #28a745;
  font-weight: bold;
}

/* Login Page Styles */
.login-form {
  max-width: 400px;
  margin: 0 auto;
}

.login-form .form-section {
  display: block;
  grid-template-columns: none;
  max-width: 100%;
  padding: 30px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-group input {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.login-form .form-group input:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(222, 148, 245, 0.3);
}

.login-form .submit-btn {
  width: 100%;
  margin-top: 10px;
}

.error-message {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 20%, 40%, 60%, 80% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70% {
    transform: translateX(-5px);
  }
}

/* Responsive Design for everything yay */

/* Large Desktop Screens */
@media (max-width: 1200px) {
  .learning-sidebar {
    flex: 0 0 300px;
  }
  
  .content {
    gap: 20px;
  }
}

/* Tablet and Medium Screens */
@media (max-width: 768px) {
  /* Layout Changes */
  header {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    text-align: center;
  }
  
  h1 {
    font-size: 18px;
    margin-bottom: 10px;
  }
  
  .top-nav {
    width: 100%;
  }
  
  .top-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  
  .top-nav li {
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
    flex: 0 0 auto;
  }
  
  .entries-btn, .vocab-btn, .kanji-btn, .syntax-btn, 
  .homework-btn, .admin-btn, .login-btn, .conversations-btn, 
  .scrapbook-btn, .nav-link, .logout-btn {
    font-size: 12px;
    white-space: nowrap;
  }

  .content {
    flex-direction: column;
    gap: 20px;
    padding:15px;
    align-items:center;
  }
  
  .entries-container {
    order: 2;
    width:100%;
    max-width:100%;
    margin:0 auto;
    box-sizing: border-box;
  }

  .post {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 20px auto;
    padding: 15px;
    box-sizing: border-box;
  }
  
  .japanese-date {
    max-width: 90%; 
    margin: 0 auto 15px auto;
  }
  
  #syntax-text {
    padding: 12px;
    word-wrap: break-word; 
    overflow-wrap: break-word;
    max-width: 100%;
  }
  
  .learning-sidebar {
    order: 1;
    flex: none;
    width: 95vw; 
    max-width: calc(100vw - 20px);
    min-width: 300px; 
    position: static;
    max-height: 90vh; 
    margin: 0 auto;
    box-sizing: border-box;
  }
  
  .learning-sidebar h3 {
    font-size: 16px;
  }
  
  .learning-card {
    margin-bottom: 15px;
    overflow-x: auto;
    word-wrap: break-word;
  }
  
  .learning-card h4 {
    font-size: 14px;
  }
  
  .kanji-main {
    font-size: 28px;
  }
  
  .vocab-main {
    font-size: 18px;
  }

  /* Form and Filter Layout */
  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .filter-sort-section {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  .filter-controls,
  .sort-controls {
    justify-content: space-between;
  }
  
  .filter-sort-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  /* Table Adjustments */
  .table-container {
    font-size: 14px;
  }
  
  .data-table th,
  .data-table td {
    padding: 8px 6px;
  }
  
  .actions-cell {
    flex-direction: column;
    gap: 4px;
  }

  /* Media and Modal */
  .entry-media {
    gap: 8px;
  }
  
  .media-item {
    max-width: 280px;
  }
  
  .close {
    font-size: 30px;
    width: 40px;
    height: 40px;
    top: -40px;
  }
  
  .modal {
    padding: 10px;
  }
  
  .modal-content img,
  .modal-content video {
    max-height: 80vh;
  }

  .image-modal {
    padding: 10px;
  }
  
  .image-modal-content img {
    max-height: 80vh;
  }
  
  .close-image-modal {
    font-size: 30px;
    width: 40px;
    height: 40px;
    top: -50px;
    right: -5px;
  }
  
  .modal-image-title {
    font-size: 16px;
    margin-top: 10px;
  }
  /* Homework Components */
  .homework-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .homework-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .homework-actions {
    align-self: flex-end;
  }

  /* Scrapbook Layout */
  .scrapbook-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .edit-modal-content {
    width: 95%;
    padding: 20px;
  }
  
  .edit-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .edit-btn-save,
  .edit-btn-cancel {
    width: 100%;
  }

  /* Quiz Layout */
  .quiz-form-row {
    flex-direction: column;
    align-items: center;
  }
  
  .quiz-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .choices-container {
    grid-template-columns: 1fr;
  }
  
  .results-stats {
    flex-direction: column;
  }
  
  .results-actions {
    flex-direction: column;
  }

  /* Conversation Elements */
  .dialogue-line::before {
    left: -10px;
    width: 16px;
    height: 16px;
    font-size: 8px;
  }
  
  .speaker-label {
    min-width: 60px;
    font-size: 11px;
    padding: 3px 6px;
  }
  
  .subject-badge {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .conversation-japanese::before,
  .conversation-english::before {
    font-size: 10px;
    padding: 3px 6px;
  }

  /* Pagination */
  .pagination-nav {
    gap: 5px;
  }
  
  .pagination-btn,
  .pagination-link {
    padding: 6px 8px;
    font-size: 12px;
    min-width: 35px;
  }
  
  .pagination-info {
    font-size: 12px;
  }
  
  .items-per-page {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table {
    min-width: 700px;
    font-size: 13px;
  }
  
  .data-table th,
  .data-table td {
    padding: 10px 8px;
  }

   .login-form .form-section {
    padding: 20px;
    margin: 0 -15px;
  }
  
  .login-form {
    max-width: 100%;
  }
}

/* Mobile and Small Screens */
@media (max-width: 480px) {
  /* Header Mobile Layout */
  header {
    padding: 10px;
    gap: 10px;
  }
  
  h1 {
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .top-nav ul {
    gap: 5px;
  }
  
  .top-nav li {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  .entries-btn, .vocab-btn, .kanji-btn, .syntax-btn, 
  .homework-btn, .admin-btn, .login-btn, .conversations-btn, 
  .scrapbook-btn, .nav-link, .logout-btn {
    font-size: 11px;
  }
/* Universal Reset for All Tables */
  * {
    box-sizing: border-box;
  }
  
  /* Force all containers to respect viewport */
  body > *,
  .content > *,
  .main-content > * {
    max-width: 100vw;
    overflow-x: visible;
  }
  body .content {
    padding: 8px;
    align-items: center;
  }

  .entries-container {
    width: 100%;
    max-width: 100%;
    margin: 0; 
    padding: 0; 
  }

  .post {
    width: 100%;
    max-width: 100%;
    margin: 0 0 15px 0;
    padding: 10px;
    box-sizing: border-box;
  }
  
  .japanese-date {
    max-width: 95%; 
    margin: 0 auto 12px auto;
    font-size: 14px; 
    padding: 10px;
  }
  
  .syntax-block {
    width: 100%;
    margin: 0;
    padding:0;
  }
  
  #syntax-text {
    padding: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto; 
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 15px;
    font-size: 14px;
    line-height:1.5;
  }

 /* Mobile Learning Sidebar */
  .learning-sidebar {
    width: 100%; 
    max-width: none; 
    min-width: auto; 
    max-height: 350px; 
    padding: 15px;
    margin: 0; 
    box-sizing: border-box;
  }
  
  .learning-sidebar h3 {
    font-size: 14px;
    margin-bottom: 15px;
  }
  .vocab-reading,
  .kanji-reading {
    font-size: 12px;
  }
  
  .vocab-meaning,
  .kanji-meaning,
  .syntax-meaning {
    font-size: 12px;
  }
  .learning-card {
    margin-bottom: 12px;
    padding: 12px; 
  }
  
  .learning-card h4 {
    font-size: 13px;
    margin-bottom: 10px;
  }
  
  .kanji-main {
    font-size: 24px; 
  }
  
  .vocab-main {
    font-size: 16px;
  }
  
  .refresh-btn {
    width: 25px;
    height: 25px;
    font-size: 12px;
  }
  /* Admin Layout */
  .admin-page .content {
    padding: 10px;
  }
  
  .form-section {
    padding: 15px;
  }
  
  .helper-buttons-column {
    flex-direction: column;
  }
  
  .helper-btn {
    width: 100%;
    min-width: auto;
  }

   /* Mobile Table Fixes */
  body .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; 
    border-radius: 8px;
    margin: 0 -8px; 
    padding: 0 8px; 
  }
  
  body .data-table {
    min-width: 600px; 
    font-size: 12px;
  }
  
  body .data-table th {
    padding: 8px 6px;
    font-size: 12px;
  }
  
  body .data-table td {
    padding: 8px 6px;
    font-size: 12px;
    vertical-align: top;
  }

  body .data-table th,
  body .data-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* Specific column widths for better mobile display */
  body #kanjiTable th:nth-child(1), /* Character */
  body #kanjiTable td:nth-child(1) {
    min-width: 60px;
    text-align: center;
  }
  
  body #kanjiTable th:nth-child(2), /* Meaning */
  body #kanjiTable td:nth-child(2) {
    min-width: 120px;
  }
  
  body #kanjiTable th:nth-child(3), /* On Reading */
  body #kanjiTable td:nth-child(3) {
    min-width: 80px;
  }
  
  body #kanjiTable th:nth-child(4), /* Kun Reading */
  body #kanjiTable td:nth-child(4) {
    min-width: 80px;
  }
  
  body #kanjiTable th:nth-child(5), /* Strokes */
  body #kanjiTable td:nth-child(5) {
    min-width: 60px;
    text-align: center;
  }
  
  body #kanjiTable th:nth-child(6), /* Category */
  body #kanjiTable td:nth-child(6) {
    min-width: 90px;
  }
  
  body #kanjiTable th:nth-child(7), /* Type */
  body #kanjiTable td:nth-child(7) {
    min-width: 70px;
  }

  body #kanjiTable th:nth-child(8), /* Actions */
  body #kanjiTable td:nth-child(8) {
    min-width: 120px;
  }
  
  /* Vocab Table Specific */
  body #vocabTable th:nth-child(1), /* Romaji */
  body #vocabTable td:nth-child(1) {
    min-width: 100px;
  }

  body #vocabTable th:nth-child(2), /* Kana */
  body #vocabTable td:nth-child(2) {
    min-width: 100px;
  }
  
  body #vocabTable th:nth-child(3), /* Kanji */
  body #vocabTable td:nth-child(3) {
    min-width: 80px;
  }

  body #vocabTable th:nth-child(4), /* English */
  body #vocabTable td:nth-child(4) {
    min-width: 120px;
  }
  
  body #vocabTable th:nth-child(5), /* Class */
  body #vocabTable td:nth-child(5) {
    min-width: 80px;
  }

  body #vocabTable th:nth-child(6), /* Category */
  body #vocabTable td:nth-child(6) {
    min-width: 90px;
  }
  
  body #vocabTable th:nth-child(7), /* Actions */
  body #vocabTable td:nth-child(7) {
    min-width: 120px;
  }

  body #kanjiTable td:nth-child(2),
  body #vocabTable td:nth-child(4) {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
  }
  
  /* Mobile Action Buttons */
  body .actions-cell {
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
  }
  
  body .edit-btn,
  body .delete-btn {
    padding: 4px 8px;
    font-size: 11px;
    width: 100%;
  }
  
  /* Japanese Text Mobile Adjustments */
  .kanji-character {
    font-size: 18px;
    font-weight: bold;
  }
  
  .romaji-text,
  .kana-text,
  .kanji-text {
    font-size: 14px;
  }
  
  /* Class and Category Badges Mobile */
  body .class-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
  
  body .jukugo-badge,
  body .single-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
  
  /* Table scroll indicator */
  body .table-container::after {
    content: "← Scroll to see more →";
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--dark-purple);
    font-style: italic;
    margin-top: 8px;
    opacity: 0.7;
  }

  body .table-container:not([data-scrollable])::after {
    display: none;
  }

  /* Media and Modal Adjustments */
  .entry-media {
    gap: 6px;
  }
  
  .media-item {
    max-width: calc(100vw - 40px);
  }
  
  .modal-content {
    max-width: 95%;
  }
  
  .modal-content img,
  .modal-content video {
    max-width: 100%;
    height: auto;
  }
  
  .close {
    font-size: 25px;
    width: 35px;
    height: 35px;
    top: -45px;
  }

  /* Homework and Scrapbook */
  .homework-item {
    padding: 15px;
  }
  
  .scrapbook-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .scrapbook-date {
    align-self: flex-end;
  }

  .image-modal-content img {
    max-height: 75vh;
  }

  .close-modal,
  .close-image-modal {
    font-size: 25px;
    width: 35px;
    height: 35px;
    top: -45px;
  }

  .modal-image-title {
    font-size: 14px;
  }

  /* Pagination Mobile */
  .pagination-container {
    padding: 15px;
    margin: 20px 0;
  }
  
  .pagination-nav {
    gap: 3px;
  }
  
  .pagination-btn,
  .pagination-link {
    padding: 4px 6px;
    font-size: 11px;
    min-width: 30px;
  }
  .filter-sort-section {
    margin: 0 -8px 20px -8px; /* Offset content padding */
    padding: 15px 8px;
    border-radius: 8px;
  }
  
  .filter-controls,
  .sort-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }
  
  .filter-controls label,
  .sort-controls label {
    font-size: 12px;
    margin-bottom: 4px;
  }
  
  .filter-controls select,
  .sort-controls select {
    width: 100%;
    padding: 8px;
    font-size: 12px;
  }
  
  .search-container {
    flex-direction: column;
    gap: 8px;
  }
  
  .search-container input[type="text"] {
    width: 100%;
    font-size: 14px;
  }
  
  .search-btn,
  .clear-search-btn,
  .clear-filters-btn {
    width: 100%;
    padding: 8px;
    font-size: 12px;
  }

  .login-form .form-section {
    padding: 15px;
    margin: 0 -8px;
  }
  
  .login-form .form-group input {
    padding: 12px;
    font-size: 14px;
  }
  
  .login-form .submit-btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}