/* Board Flashcards Styles - Specifické styly pro flashcards nástěnku */

.flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem 0;
  perspective: 1000px;
}

.flashcard {
  background-color: transparent;
  width: 100%;
  height: 220px;
  perspective: 1000px;
  cursor: pointer;
  position: relative;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 16px;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: 16px;
  /* Automatické přizpůsobení velikosti textu podle velikosti kartičky */
  font-size: clamp(1.0rem, 3.5vw, 2.2rem);
  overflow-y: auto;
  font-weight: 500;
}

.flashcard-front {
  background-color: #FFFFFF;
  color: #333;
  border: 2px solid #eee;
}

.flashcard-back {
  background-color: #FFCB2B;
  color: #333;
  transform: rotateY(180deg);
  border: 2px solid #e0b020;
}

/* Theme overrides */
.theme-blue .flashcard-back {
  background-color: #4da6ff;
  border-color: #3385cc;
  color: #FFFFFF;
}

.theme-green .flashcard-back {
  background-color: #4dff88;
  border-color: #2ecc60;
}

.theme-pink .flashcard-back {
  background-color: #ff99cc;
  border-color: #cc6699;
}

.theme-purple .flashcard-back {
  background-color: #cc99ff;
  border-color: #9966cc;
  color: #FFFFFF;
}

.theme-orange .flashcard-back {
  background-color: #ff944d;
  border-color: #cc6633;
  color: #FFFFFF;
}

/* Individual card colors (overrides theme) */
.flashcard.card-color-white .flashcard-back {
  background-color: #FFFFFF;
  color: #333;
  border-color: #eee;
}

.flashcard.card-color-yellow .flashcard-back {
  background-color: #FFCB2B;
  color: #333;
  border-color: #e0b020;
}

.flashcard.card-color-blue .flashcard-back {
  background-color: #4da6ff;
  color: #FFFFFF;
  border-color: #3385cc;
}

.flashcard.card-color-green .flashcard-back {
  background-color: #4dff88;
  color: #333;
  border-color: #2ecc60;
}

.card-delete-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ff4444;
  color: #FFFFFF;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.card-image {
  max-width: 100%;
  max-height: 120px;
  margin-top: 0.5rem;
  border-radius: 8px;
}

/* Fullscreen Overlay */
.fullscreen-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fullscreen-card-container {
  width: 90%;
  max-width: 600px;
  height: 60vh;
  perspective: 1000px;
}

/* Větší text pro fullscreen kartičky */
.fullscreen-overlay .flashcard-front,
.fullscreen-overlay .flashcard-back {
  font-size: clamp(1.5rem, 6vh, 4rem);
}

.fullscreen-controls {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  z-index: 10000;
}

.fullscreen-btn {
  background: #FFFFFF;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2rem;
  transition: transform 0.2s;
}

.fullscreen-btn:hover {
  transform: scale(1.05);
}

.fullscreen-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  background: #e0e0e0;
}

.close-fullscreen {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #FFFFFF;
  font-size: 3rem;
  cursor: pointer;
  z-index: 10001;
}

.progress-container {
  width: 90%;
  max-width: 600px;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: #FFCB2B;
  width: 0%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Wrapper pro obsah kartičky - umožňuje inline zobrazení */
.flashcard-content {
  display: block;
  text-align: center;
  max-width: 100%;
  word-wrap: break-word;
  line-height: 1.6;
  white-space: normal;
}

/* LaTeX/MathJax styling - zabránění zalamování vzorců */
/* Pro inline math (MathJax 3 používá mjx-container bez display="true") */
.flashcard-content mjx-container:not([display="true"]) {
  display: inline !important;
  white-space: nowrap !important;
  vertical-align: baseline !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

/* Všechny vnitřní elementy inline math musí být inline */
.flashcard-content mjx-container:not([display="true"]) > * {
  display: inline !important;
  white-space: nowrap !important;
}

/* Zabránění zalamování inline math na více řádků */
.flashcard-content mjx-container:not([display="true"]) mjx-math {
  white-space: nowrap !important;
  display: inline !important;
}

/* Pro všechny MathJax elementy v inline math - musí být inline */
.flashcard-content mjx-container:not([display="true"]) mjx-mrow,
.flashcard-content mjx-container:not([display="true"]) mjx-mfrac,
.flashcard-content mjx-container:not([display="true"]) mjx-msup,
.flashcard-content mjx-container:not([display="true"]) mjx-msub,
.flashcard-content mjx-container:not([display="true"]) mjx-mn,
.flashcard-content mjx-container:not([display="true"]) mjx-mi,
.flashcard-content mjx-container:not([display="true"]) mjx-mo {
  display: inline !important;
}

/* Pro display math (blokové vzorce) - zobrazí se na vlastním řádku */
.flashcard-content mjx-container[display="true"] {
  display: block !important;
  white-space: normal;
  margin: 0.5em auto;
  text-align: center;
}
