/* Felugró ablak (PDF-, videó- és animáció-néző) – natív <dialog> elemre épül */

.modal {
  width: min(1100px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-solid);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal::backdrop {
  background: rgba(10, 9, 12, .6);
  backdrop-filter: blur(4px);
}
.modal[open] { display: flex; flex-direction: column; animation: modal-in .2s var(--ease); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--border);
}
.modal__title { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal__head .tag { margin-bottom: 2px; }
.modal__head-text { min-width: 0; }
.modal__tools { display: flex; gap: 8px; align-items: center; flex: none; }

.modal__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--warm);
}

.modal__desc { padding: 16px 20px; margin: 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); }

/* Animáció beágyazás */
.anim-frame {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 78dvh;
  border: 0;
  background: var(--bg);
}

/* Feladat + megoldás fülek */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--border-2); }
.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--card-solid); color: var(--text); box-shadow: var(--shadow-sm); }

@media (max-width: 600px) {
  .modal__tools .btn span { display: none; }
  /* mobilon az ablak kitölti a képernyőt – több hely a PDF-nek */
  .modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .modal__head { padding: 10px 10px 10px 14px; gap: 8px; }
  .modal__title { font-size: 15px; }
  .modal__tools { gap: 4px; }
  .modal__tools .btn { padding: 7px 9px; }
  .modal__desc { display: none; }
  .modal .pdf-reader { height: auto; flex: 1; }
  .modal__body { display: flex; flex-direction: column; }
  .modal__body > div:only-child { flex: 1; display: flex; flex-direction: column; }
}

/* PDF-nézőnél az ablak maga ne görgessen – csak a néző lapjai */
.modal__body:has(.pdf-reader) { overflow: hidden; }
