/**
 * ARBooksLibrary - Könyv Tartalomjegyzék Kártyák Stíluslap (book-toc.css)
 * A multilearn.online kártyarendszer adaptációja az ARBooksLibrary dizájnjához
 */

:root {
  --book-toc-primary: #800870;
  --book-toc-primary-hover: #9c128a;
  --book-toc-primary-light: #fbf2fa;
  --book-toc-text: #1e293b;
  --book-toc-text-muted: #64748b;
  --book-toc-border: #e2e8f0;
  --book-toc-bg: #ffffff;
  --book-toc-card-bg: #ffffff;
  --book-toc-subcard-bg: #f8fafc;
  --book-toc-subcard-border: #edf2f7;
  --book-toc-radius: 8px;
  --book-toc-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --book-toc-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Fő konténer */
.book-toc-wrapper {
  font-family: inherit;
  color: var(--book-toc-text);
}

/* Ha a tartalomjegyzék termékoldali lenyíló panelben (.tartalom-section vagy .panel-body) helyezkedik el */
.product-description .tartalom-section .panel-body:has(.book-toc-wrapper),
.product-description .panel-body:has(.book-toc-wrapper) {
  padding: 16px 16px;
}

/* ========================================================
   FEJEZETEK (Többfejezetes nézet esetén)
   ======================================================== */
.book-toc-chapters-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.book-toc-chapter-panel {
  background: var(--book-toc-bg);
  border: 1px solid var(--book-toc-border);
  border-radius: var(--book-toc-radius);
  overflow: hidden;
  box-shadow: var(--book-toc-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.book-toc-chapter-panel:hover {
  border-color: #cbd5e1;
}

.book-toc-chapter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #ffffff;
  cursor: pointer;
  user-select: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background-color 0.2s ease;
}

.book-toc-chapter-header:hover {
  background: #f8fafc;
}

.book-toc-chapter-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.book-toc-chapter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--book-toc-primary);
  font-size: 14px;
  transition: transform 0.25s ease;
}

.book-toc-chapter-panel.is-collapsed .book-toc-chapter-icon {
  transform: rotate(-90deg);
}

.book-toc-chapter-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.35;
}

.book-toc-chapter-badge {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  white-space: nowrap;
  letter-spacing: 0.2px;
  margin-left: 12px;
}

.book-toc-chapter-body {
  padding: 16px 18px 18px 18px;
  border-top: 1px solid var(--book-toc-border);
  background: #fafafa;
}

.book-toc-chapter-panel.is-collapsed .book-toc-chapter-body {
  display: none;
}

.book-toc-chapter-desc {
  font-size: 13.5px;
  color: var(--book-toc-text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ========================================================
   LECKÉK RÁCSA (GRID)
   ======================================================== */
.book-toc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ========================================================
   LECKÉK KÁRTYA (LESSON CARD)
   ======================================================== */
.book-toc-card {
  background: var(--book-toc-card-bg);
  border: 1px solid var(--book-toc-border);
  border-radius: var(--book-toc-radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--book-toc-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  min-width: 0;
}

.book-toc-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--book-toc-shadow-hover);
  transform: translateY(-1px);
}

.book-toc-card-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

/* Bal oldali média oszlop (borítókép + számlálók alatta) */
.book-toc-card-side {
  width: 105px;
  min-width: 105px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

/* Lecke borítókép */
.book-toc-card-thumb-wrap {
  width: 100%;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  background: #f1f5f9;
  position: relative;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.book-toc-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.book-toc-card:hover .book-toc-card-thumb {
  transform: scale(1.03);
}

/* Lecke szöveges tartalom */
.book-toc-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.book-toc-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
  line-height: 1.35;
  word-break: normal;
}

.book-toc-card-desc {
  font-size: 13px;
  color: var(--book-toc-text-muted);
  margin-bottom: 0;
  line-height: 1.45;
}

/* ========================================================
   SZÁMLÁLÓK (COUNTS BADGES - Kép alatti oszlopban)
   ======================================================== */
.book-toc-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  width: 100%;
  padding-top: 1px;
}

.book-toc-count-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  line-height: 1;
  white-space: nowrap; /* Mindig együtt tartja az ikont és a számot, sosem törik el a sor végén */
}

.book-toc-count-icon {
  font-size: 12px;
  line-height: 1;
}

/* Különböző számláló típusok ikon színei */
.book-toc-count-item[data-type="slides"] .book-toc-count-icon { color: #64748b; }
.book-toc-count-item[data-type="videos"] .book-toc-count-icon { color: #dc2626; }
.book-toc-count-item[data-type="images"] .book-toc-count-icon { color: #d97706; }
.book-toc-count-item[data-type="webgl"]  .book-toc-count-icon { color: #7c3aed; }
.book-toc-count-item[data-type="tests"]  .book-toc-count-icon { color: #16a34a; }
.book-toc-count-item[data-type="docs"]   .book-toc-count-icon { color: #0284c7; }
.book-toc-count-item[data-type="audio"]  .book-toc-count-icon { color: #e11d48; }

/* ========================================================
   MULTIMÉDIA SZEKCIÓ
   (Egyetlen szürke blokk a címnek és a multimédia elemeknek)
   ======================================================== */
.book-toc-media-section {
  margin-top: auto;
  background: var(--book-toc-subcard-bg);
  border: 1px solid var(--book-toc-subcard-border);
  border-radius: 6px;
  padding: 6px 8px 6px 8px;
}

.book-toc-media-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--book-toc-text-muted);
  margin-bottom: 4px;
  padding-left: 1px;
  line-height: 1.2;
}

.book-toc-media-label i {
  font-size: 12px;
  color: var(--book-toc-primary);
}

.book-toc-media-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.book-toc-media-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 1px 2px;
  transition: background-color 0.15s ease;
}

.book-toc-media-card:hover {
  background: rgba(0, 0, 0, 0.03);
}

.book-toc-media-thumb {
  width: 40px;
  min-width: 40px;
  height: 28px;
  border-radius: 3px;
  object-fit: cover;
  background: #e2e8f0;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: block;
}

.book-toc-media-info {
  flex: 1;
  min-width: 0;
}

.book-toc-media-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================================
   RESZPONZÍV TÖRÉSPONTOK (RESPONSIVE STYLES)
   ======================================================== */

/* Tabletek és kis képernyők (< 992px): Váltás 1 oszlopos megjelenítésre */
@media (width < 992px) {
  .book-toc-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .book-toc-card-side {
    width: 110px;
    min-width: 110px;
  }
  .book-toc-card-thumb-wrap {
    height: 76px;
  }
  .book-toc-card-title {
    font-size: 14px;
  }
}

/* Mobil nézet (< 768px): Automatikus 1 oszlopos megjelenítés */
@media (width < 767px) {
  .book-toc-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .book-toc-chapter-header {
    padding: 12px 14px;
  }
  .book-toc-chapter-title {
    font-size: 15px;
  }
  .book-toc-chapter-badge {
    font-size: 11px;
    padding: 3px 8px;
    margin-left: 8px;
  }
  .book-toc-chapter-body {
    padding: 12px;
  }
  .book-toc-card {
    padding: 12px;
  }
}

/* Nagyon kis telefon képernyők (< 480px): Kompakt képelrendezés */
@media (width < 480px) {
  .book-toc-card-main {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .book-toc-card-side {
    width: 100%;
    min-width: 100%;
    gap: 6px;
  }
  .book-toc-card-thumb-wrap {
    width: 100%;
    min-width: 100%;
    height: 140px;
  }
  .book-toc-card-title {
    font-size: 14.5px;
  }
  .book-toc-counts {
    gap: 8px;
  }
  .book-toc-count-item {
    font-size: 11.5px;
  }
  .book-toc-media-thumb {
    width: 38px;
    min-width: 38px;
    height: 28px;
  }
  .book-toc-media-title {
    font-size: 12px;
  }
}
