/* ITHH — «Ρώτησέ μας» σε όλο το Moodle (κουμπί κάτω δεξιά + παράθυρο ερώτησης) και καθαρό footer για τον μαθητή. namespace: ithh-
   21/11/2026, απόφαση Loukas. Το script είναι το ithh-help.js· τα σημάδια html.itha-learner / html.itha-user τα βάζει το plugin.
   22/11/2026: δύο επιλογές (AI / καθηγητής) και παράθυρο «Ρώτα το AI» — ΔΟΚΙΜΗ μόνο στο μάθημα 17 (το script βάζει το μενού
   .ithh-menu στη σελίδα μόνο εκεί, TEST_COURSES στο JS· οι κανόνες του δεν πιάνουν τίποτα στα άλλα μαθήματα). */

/* Footer του Moodle (στο κινητό στο κάτω μέρος της σελίδας, σε υπολογιστή μέσα στο «?»): ο μαθητής δεν βλέπει τίποτα από αυτό
   («Contact site support», «Έχετε συνδεθεί ως», ξενάγηση, διατήρηση δεδομένων, εναλλαγή θέματος, «Με την υποστήριξη του Moodle»).
   Την επικοινωνία την κάνει το κουμπί «Ρώτησέ μας»· η αποσύνδεση είναι στο μενού του χρήστη. Ο διαχειριστής τα βλέπει όλα. */
html.itha-learner #page-footer .footer-content-popover,
html.itha-learner #page-footer .btn-footer-popover,
html.itha-learner .footer-section { display: none !important; }

#ithh-layer { --ink:#0a1317; --text:#1c1e21; --muted:#5d6c7b; --line:#dbe2ea; --soft:#f3f6f9; --blue:#0064e0; --blue-deep:#0457cb; --blue-tint:#e8f2fe;
  --green:#1f8a3b; --green-tint:#e6f4ea; --red:#b3261e; --fh:'Inter',-apple-system,'Segoe UI',sans-serif; --fb:'Source Sans 3',-apple-system,'Segoe UI',sans-serif;
  font-family: var(--fb); font-size: 16px; line-height: 1.45; color: var(--text); text-align: left; }
#ithh-layer *, #ithh-layer *::before, #ithh-layer *::after { box-sizing: border-box; }
#ithh-layer button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
#ithh-layer button:focus-visible, #ithh-layer textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
#ithh-layer svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#ithh-layer .ithh-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 1035; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 11px 20px 11px 15px; border-radius: 99px; background: var(--blue); color: #fff; font-family: var(--fh); font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(10,19,23,.24); }
#ithh-layer .ithh-fab:hover { background: var(--blue-deep); }
/* Μέσα σε προσπάθεια quiz: μόνο εικονίδιο, πάνω από την κολλημένη γραμμή «Προηγούμενη / Επόμενη ερώτηση», για να μη σκεπάζει την ερώτηση. */
body#page-mod-quiz-attempt #ithh-layer .ithh-fab { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: 48px; padding: 0; justify-content: center; }
body#page-mod-quiz-attempt #ithh-layer .ithh-fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body#page-mod-quiz-attempt #ithh-layer .ithh-fab svg { width: 24px; height: 24px; }

/* Δύο επιλογές πάνω από το κουμπί (μόνο όπου το script βάζει το .ithh-menu). Ανοίγουν με μικρή κίνηση από τη γωνία του κουμπιού·
   το εικονίδιο του κουμπιού γίνεται «x». Κλείνουν με δεύτερο πάτημα, με πάτημα έξω ή με Esc. */
#ithh-layer .ithh-fab-i { display: grid; place-items: center; font-style: normal; }
#ithh-layer .ithh-fab-i svg { grid-area: 1 / 1; transition: transform .22s ease, opacity .16s ease; }
#ithh-layer .ithh-fab-i .ithh-fab-x { opacity: 0; transform: rotate(-90deg); }
#ithh-layer.ithh-open .ithh-fab-i svg { opacity: 0; transform: rotate(90deg); }
#ithh-layer.ithh-open .ithh-fab-i .ithh-fab-x { opacity: 1; transform: none; }
#ithh-layer .ithh-menu { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 1035; display: flex; flex-direction: column;
  align-items: flex-end; gap: 10px; visibility: hidden; pointer-events: none; transition: visibility 0s linear .22s; }
#ithh-layer.ithh-open .ithh-menu { visibility: visible; pointer-events: auto; transition-delay: 0s; }
#ithh-layer .ithh-opt { display: flex; align-items: center; gap: 12px; min-width: 250px; min-height: 60px; padding: 9px 18px 9px 10px; border: 1px solid var(--line);
  border-radius: 18px; background: #fff; box-shadow: 0 8px 26px rgba(10,19,23,.18); text-align: left; opacity: 0; transform: translateY(16px) scale(.88);
  transform-origin: 100% 100%; transition: opacity .16s ease, transform .24s cubic-bezier(.2,.9,.3,1.25), border-color .15s ease; }
#ithh-layer.ithh-open .ithh-opt { opacity: 1; transform: none; }
#ithh-layer.ithh-open .ithh-opt:first-child { transition-delay: .07s, .07s, 0s; }
#ithh-layer .ithh-opt:hover { border-color: var(--blue); }
.ithh-opt-i { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-tint); color: var(--blue-deep); }
.ithh-opt-i.ithh-opt-ai { background: var(--blue); color: #fff; }
.ithh-opt-t { display: flex; flex-direction: column; min-width: 0; }
.ithh-opt-t b { font-family: var(--fh); font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.ithh-opt-t small { font-size: 13px; line-height: 1.3; color: var(--muted); }
/* Μέσα σε προσπάθεια quiz: πάνω από τον μικρό κύκλο, μικρές (μία γραμμή, χωρίς υπότιτλο), για να μη σκεπάζουν την ερώτηση. */
body#page-mod-quiz-attempt #ithh-layer .ithh-menu { bottom: calc(142px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
body#page-mod-quiz-attempt #ithh-layer .ithh-opt { min-width: 0; min-height: 48px; gap: 10px; padding: 5px 16px 5px 6px; border-radius: 99px; }
body#page-mod-quiz-attempt #ithh-layer .ithh-opt small { display: none; }
body#page-mod-quiz-attempt #ithh-layer .ithh-opt-i { width: 36px; height: 36px; }

/* Πλαϊνά μενού του Moodle (ευρετήριο μαθήματος, περιεχόμενα βιβλίου): χώρος στο τέλος τους για να μη σκεπάζει το κουμπί την τελευταία
   γραμμή· στο κινητό, όσο είναι ανοιχτό ένα μενού (πιάνει όλη την οθόνη), το κουμπί κρύβεται. */
html.ithh-on .drawer .drawercontent { padding-bottom: 84px; }
@media (max-width: 767.98px) { body:has(.drawer.show) #ithh-layer .ithh-fab, body:has(.drawer.show) #ithh-layer .ithh-menu { display: none; } }

.ithh-bg { position: fixed; inset: 0; z-index: 1060; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10,19,23,.48); }
.ithh-modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 20px; border-radius: 20px; background: #fff; box-shadow: 0 20px 60px rgba(10,19,23,.3); }
.ithh-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
#ithh-layer h3 { margin: 0; font-family: var(--fh); font-size: 19px; font-weight: 600; line-height: 1.3; color: var(--ink); }
#ithh-layer p { margin: 0; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
#ithh-layer p b { color: var(--ink); font-weight: 600; }
#ithh-layer .ithh-x { flex: none; width: 36px; height: 36px; margin: -6px -8px 0 0; display: grid; place-items: center; border-radius: 10px; color: var(--muted); }
#ithh-layer .ithh-x:hover { background: var(--soft); color: var(--ink); }
.ithh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#ithh-layer .ithh-chips button { min-height: 36px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 14px; color: var(--text); }
#ithh-layer .ithh-chips button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-tint); color: var(--blue-deep); font-weight: 600; }
#ithh-layer textarea { display: block; width: 100%; min-height: 130px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); resize: vertical; }
#ithh-layer textarea:focus { border-color: var(--blue); }
#ithh-layer .ithh-err { color: var(--red); font-size: 14px; }
.ithh-f { display: flex; justify-content: flex-end; gap: 6px; }
#ithh-layer .ithh-send { min-height: 46px; padding: 10px 24px; border-radius: 12px; background: var(--blue); color: #fff; font-family: var(--fh); font-size: 15px; font-weight: 600; }
#ithh-layer .ithh-send:hover { background: var(--blue-deep); }
#ithh-layer .ithh-send:disabled { background: #b9c6d4; cursor: default; }
#ithh-layer .ithh-cancel { min-height: 46px; padding: 10px 16px; border-radius: 12px; font-size: 15px; color: var(--muted); }
.ithh-sent { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0 4px; text-align: center; }
.ithh-sent-i { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--green-tint); color: var(--green); }
#ithh-layer .ithh-sent-i svg { width: 28px; height: 28px; stroke-width: 2.2; }
.ithh-sent .ithh-send { margin-top: 8px; }

/* Παράθυρο «Ρώτα το AI»: ερώτηση (φούσκα δεξιά), απάντηση (φούσκα αριστερά, με σήμανση AI) και από κάτω «Δεν με κάλυψε, ρώτα τον καθηγητή». */
.ithh-ai { overflow: hidden; }
#ithh-layer .ithh-ai h3 { display: flex; align-items: center; gap: 10px; }
.ithh-ai-i { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; }
#ithh-layer .ithh-ai-i svg { width: 18px; height: 18px; }
#ithh-layer .ithh-demo { padding: 9px 12px; border: 1px solid #efd48a; border-radius: 12px; background: #fff7df; color: #6b4e00; font-size: 14px; }
#ithh-layer .ithh-demo b { margin-right: 8px; font-family: var(--fh); font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #6b4e00; }
.ithh-thread { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.ithh-ex { display: flex; flex-direction: column; gap: 8px; }
#ithh-layer .ithh-ex p { font-size: 14px; }
#ithh-layer .ithh-ex .ithh-chips button { text-align: left; }
.ithh-bq { align-self: flex-end; max-width: 88%; padding: 9px 13px; border-radius: 16px 16px 4px 16px; background: var(--blue); color: #fff; font-size: 15px; overflow-wrap: anywhere; }
.ithh-ba { align-self: flex-start; max-width: 94%; display: flex; flex-direction: column; gap: 8px; padding: 11px 13px; border-radius: 16px 16px 16px 4px; background: var(--soft);
  color: var(--ink); font-size: 15px; overflow-wrap: anywhere; }
.ithh-who { display: flex; align-items: center; gap: 6px; font-family: var(--fh); font-size: 12px; font-weight: 700; color: var(--blue-deep); }
#ithh-layer .ithh-who svg { width: 15px; height: 15px; }
.ithh-tag { margin-left: 2px; padding: 1px 8px; border: 1px solid #efd48a; border-radius: 99px; background: #fff7df; color: #6b4e00; font-size: 11px; font-weight: 600; }
#ithh-layer .ithh-esc { align-self: flex-start; min-height: 36px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 14px;
  font-weight: 600; color: var(--blue-deep); text-align: left; }
#ithh-layer .ithh-esc:hover { border-color: var(--blue); }
/* Όταν το AI λέει «αυτό είναι για τον καθηγητή» (ή δεν απάντησε): το κουμπί της μεταφοράς γίνεται το κύριο. */
#ithh-layer .ithh-esc.ithh-esc-on { border-color: var(--blue); background: var(--blue); color: #fff; }
#ithh-layer .ithh-esc.ithh-esc-on:hover { background: var(--blue-deep); }
.ithh-ba.ithh-ba-err { background: #fff; border: 1px solid var(--line); color: var(--muted); }
#ithh-layer .ithh-left { align-self: center; font-size: 13px; }
.ithh-dots { display: inline-flex; gap: 5px; padding: 4px 0; }
.ithh-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ithh-dot 1s ease-in-out infinite; }
.ithh-dots i:nth-child(2) { animation-delay: .15s; }
.ithh-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ithh-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.ithh-ask { flex: none; display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.ithh-ask:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
#ithh-layer .ithh-q { min-height: 52px; max-height: 150px; padding: 4px 6px; border: 0; border-radius: 6px; resize: none; }
#ithh-layer .ithh-q:focus-visible { outline: none; }
.ithh-ask-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ithh-count { padding-left: 6px; font-size: 13px; color: var(--muted); }
.ithh-count.ithh-count-full { color: var(--red); }
#ithh-layer .ithh-ba a { color: var(--blue-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
#ithh-layer .ithh-ask .ithh-send { width: auto; min-height: 40px; padding: 8px 22px; }
#ithh-layer .ithh-fine { font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  #ithh-layer .ithh-opt, #ithh-layer .ithh-fab-i svg { transition: none; }
  .ithh-dots i { animation: none; opacity: .6; }
}

/* Μεγάλες οθόνες: λίγο μεγαλύτερα· στη σελίδα με τη νέα εμφάνιση μαθήματος (που μεγεθύνεται) αντίστοιχα περισσότερο. */
@media (min-width: 1400px) { .ithh-modal, #ithh-layer .ithh-fab, #ithh-layer .ithh-menu { zoom: 1.15; } }
@media (min-width: 1600px) { body.ithm-on .ithh-modal, body.ithm-on #ithh-layer .ithh-fab, body.ithm-on #ithh-layer .ithh-menu { zoom: 1.35; } }
@media (max-width: 560px) {
  .ithh-bg { align-items: flex-end; padding: 0; }
  .ithh-modal { max-width: none; max-height: 92vh; max-height: 92dvh; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .ithh-f { flex-direction: column-reverse; }
  #ithh-layer .ithh-send, #ithh-layer .ithh-cancel { width: 100%; }
  #ithh-layer .ithh-fab { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  #ithh-layer .ithh-menu { right: 12px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}
@media print { #ithh-layer { display: none !important; } }
