/* Your existing CSS from the previous messages */
@font-face {
  font-family: 'IranianSans';
  src: url('IranianSans.ttf') format('truetype');
}

body {
  font-family: 'IranianSans', sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 20px;
  margin-left: 220px; /* Adjust for sidebar */
}

h1 {
  text-align: center;
  color: #222;
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 18px;
}

input#searchBox {
  display: block;
  margin: 20px auto;
  padding: 10px;
  width: 80%;
  max-width: 500px;
  font-size: 16px;
}

.week-group {
  margin-bottom: 40px;
}

.week-group h2 {
  color: #005500;
  border-bottom: 2px solid #ccc;
}

.day-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}

.day-group h3 {
  width: 100%;
  margin-bottom: 10px;
  color: #228822;
}

.flip-card {
  background-color: transparent;
  width: 280px;
  height: 260px;
  perspective: 1000px;
  transition: transform 0.3s ease;
}

.flip-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card-front,
/* Original stays for normal mode */
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 12px;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

/* Override for picture mode */
body.picture-mode .flip-card-back {
  padding: 0; /* no padding so image fills nicely */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #fff; /* fallback color behind image */
  display: block; /* don't force flex layout for images */
}


.flip-card-front {
  z-index: 2;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* Meta info row */
.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  margin-bottom: 6px;
}

.index {
  color: #008000;
  font-weight: bold;
}

.week {
  color: #004d00;
  font-weight: bold;
}

.day {
  color: #66cc66;
  font-weight: bold;
}

.word {
  font-size: 20px;
  font-weight: bold;
  color: #000;
}

.pronunciation {
  font-size: 16px;
  font-style: italic;
  margin: 4px 0;
}

.phrase {
  font-size: 14px;
  color: #008080;
}

.mnemonic strong {
  font-weight: bold;
  color: #444;
}

.synonyms {
  color: green;
  font-size: 14px;
}

.antonyms {
  color: #cc6600;
  font-size: 14px;
}

.persian {
  font-size: 15px;
  color: #005f5f;
  direction: rtl;
  text-align: right;
  margin-top: 8px;
}

.persian_2 {
  font-size: 12px;
  color: #005f5f;
  direction: rtl;
  text-align: right;
  margin-top: 8px;
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: #888;
}

.credit-name {
  color: orange;
  font-weight: bold;
}

header {
  background-color: #f8f8f8;
  padding: 30px 20px 10px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
  color: #222;
}

header .tagline {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

.author-name {
  font-size: 14px;
  color: #FF8800;
  font-weight: 600;
  margin-bottom: 5px;
}

.word-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}

.part-of-speech {
  font-size: 13px;
  color: #aaa;
  font-style: italic;
}

.flip-card-back .synonyms,
.flip-card-back .antonyms {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.flip-card-back strong {
  color: #333;
}

/* Week Selector Dropdown */
#weekSelector {
  margin-bottom: 20px;
  padding: 8px;
  font-size: 16px;
  display: block;
  width: 200px;
  margin: 0 auto;
  position: sticky;
  top: 20px;
  z-index: 100;
}

/* Sidebar navigation */
#weekNav {
  position: fixed;
  top: 80px;
  left: 0;
  width: 200px;
  max-height: 90vh;
  overflow-y: auto;
  background: #f9f9f9;
  border-right: 1px solid #ccc;
  padding: 10px;
  transition: transform 0.3s ease;
  z-index: 1000;
}

#weekNav ul li a {
  display: block;
  padding: 6px 10px;
  color: #0055aa;
  text-decoration: none;
}

#weekNav ul li a:hover {
  background-color: #e0f0ff;
  border-radius: 4px;
}

/* Collapsed by default */
#weekNav.collapsed {
  transform: translateX(-100%);
}

#weekNav:not(.collapsed) {
  transform: translateX(0);
}

/* Menu toggle button */
.menu-toggle {
  position: fixed;
  top: 20px;
  left: 10px;
  background-color: #0055aa;
  color: white;
  border: none;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  z-index: 1100;
  border-radius: 4px;
  font-family: Arial, sans-serif;
}

/* Responsive fix for mobile */
@media (max-width: 768px) {
  .container {
    margin-left: 0;
  }

  #weekNav {
    top: 60px;
    width: 80%;
  }

  #weekSelector {
    margin-top: 80px;
  }
}

html {
  scroll-behavior: smooth;
}

.top-menu {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

.top-menu a {
  padding: 10px 18px;
  background-color: #f0f0f0;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  color: #333;
  transition: background-color 0.3s, transform 0.2s;
}

.top-menu a:hover {
  background-color: #dbeafe; /* light blue */
  transform: translateY(-1px);
}

.top-menu a.active {
  background-color: #2196f3;
  color: white;
}
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card {
  user-select: none;
}

#flipAllBtn {
  margin: 10px auto;
  display: block;
  padding: 10px 20px;
  background-color: #e5e7eb; /* gray by default */
  color: #374151;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease, transform 0.15s ease;
}

#flipAllBtn.on {
  background-color: #10b981; /* green for ON */
  color: white;
}

#flipAllBtn:hover {
  transform: translateY(-2px);
}

#flipAllBtn:active {
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* Container layout */
#flipAllContainer {
  margin: 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}

/* Toggle switch base */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

/* Hide default checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider background */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

/* Slider knob */
.slider:before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

/* Checked state */
.switch input:checked + .slider {
  background-color: #10b981; /* green for ON */
}

.switch input:checked + .slider:before {
  transform: translateX(24px);
}

/* Special styling for index 0 card */
.highlight-card {
  border: 3px solid #2196f3;    /* subtle Blue border */
  /* background-color: #fff3e0;    /* light orange background */
  /* remove box-shadow animation */
}

.reload-btn {
  background: #2196f3;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin: 1rem;
  font-size: 0.9rem;
}
.reload-btn:hover {
  background: #1976d2;
}

.group-tag {
  display: inline-block;
  background: #2196f3;
  color: #fff;
  font-size: 0.8em;
  padding: 2px 6px;
  margin-top: 6px;
  border-radius: 6px;
}

