/* Raspored sati – prikaz kalendara (front + admin) */

.inv-raspored { position: relative; min-height: 120px; }
.inv-raspored.inv-loading::after {
    content: ""; position: absolute; inset: 0; z-index: 5;
    background: rgba(255,255,255,0.55) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><circle cx='20' cy='20' r='15' fill='none' stroke='%230a4c98' stroke-width='4' stroke-dasharray='60 40'><animateTransform attributeName='transform' type='rotate' from='0 20 20' to='360 20 20' dur='0.9s' repeatCount='indefinite'/></circle></svg>") center 120px no-repeat;
    pointer-events: none;
}
.inv-raspored-msg { margin: 10px 0; padding: 10px 14px; background: #fff3cd; border: 1px solid #ffe69c; color: #664d03; border-radius: 4px; }
.inv-raspored-empty { color: #666; font-style: italic; }

/* alatna traka */
.inv-raspored .fc .fc-toolbar-title { font-size: 20px; }
.inv-raspored .fc .fc-button { font-size: 14px; text-transform: none; }
.inv-raspored .fc .fc-button-primary:focus-visible { outline: 2px solid #0a4c98; outline-offset: 2px; box-shadow: none; }
.inv-raspored .inv-print-btn svg { vertical-align: -3px; }

/* termini */
.inv-raspored .fc-v-event, .inv-raspored .fc-daygrid-event { cursor: pointer; }
.inv-raspored .fc-v-event .fc-event-main { padding: 2px 4px; overflow: hidden; box-sizing: border-box; }
.inv-evt { font-size: 12px; line-height: 1.25; color: #000; overflow: hidden; }
.inv-evt-time { font-weight: 600; font-size: 11px; opacity: 0.85; }
.inv-evt-title { font-weight: 600; }
.inv-evt-lecturer, .inv-evt-loc, .inv-evt-meta { font-weight: 400; font-size: 11px; }
.inv-evt-loc { font-style: italic; }
.inv-evt-disabled { opacity: 0.7; }

/* Vrijeme od–do se na kutiji ne prikazuje (kao u starom prikazu: body:not(.calendar-print) .fc-event-time);
   vidi se u dijalogu na klik, u tooltipu i u ispisu (body.calendar-print). */
body:not(.calendar-print) .inv-raspored .inv-evt-time { display: none !important; }

/* tjedni/dnevni prikaz: sadržaj se reže na granici kutije, lokacija ostaje pri dnu (kao u starom prikazu) */
.inv-raspored .fc-timegrid-event .inv-evt { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.inv-raspored .fc-timegrid-event .inv-evt-time { flex: none; display: block; }
.inv-raspored .fc-timegrid-event .inv-evt-title { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.inv-raspored .fc-timegrid-event .inv-evt-lecturer { flex: 0 3 auto; min-height: 0; overflow: hidden; }
.inv-raspored .fc-timegrid-event .inv-evt-loc { flex: none; margin-top: auto; padding-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* kratki termini (< 45 min): samo naziv u jednom retku; srednji (< 75 min): bez izvođača */
.inv-raspored .fc-timegrid-event .inv-evt-short .inv-evt-time,
.inv-raspored .fc-timegrid-event .inv-evt-short .inv-evt-lecturer,
.inv-raspored .fc-timegrid-event .inv-evt-short .inv-evt-loc,
.inv-raspored .fc-timegrid-event .inv-evt-medium .inv-evt-lecturer { display: none; }
.inv-raspored .fc-timegrid-event .inv-evt-short .inv-evt-title { white-space: nowrap; text-overflow: ellipsis; }
.inv-raspored .fc-daygrid-event .inv-evt { white-space: nowrap; text-overflow: ellipsis; padding: 1px 3px; }
.inv-raspored .fc-daygrid-event .inv-evt-time { font-size: 11px; }
.inv-raspored .fc-list-event .inv-evt { font-size: 14px; }
.inv-raspored .fc-list-event .inv-evt-meta { font-size: 13px; color: #444; }
.inv-raspored .fc .fc-list-event-dot { border-width: 6px; }
.inv-raspored .fc .fc-more-link { font-size: 11px; }

/* dijalog */
.inv-dlg-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 99998; }
.inv-dlg {
    position: fixed; z-index: 99999; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 30px)); max-height: calc(100vh - 30px); overflow: auto;
    background: #fff; color: #222; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.35);
    padding: 20px 24px 24px; box-sizing: border-box; text-align: left;
}
.inv-dlg[hidden], .inv-dlg-backdrop[hidden] { display: none; }
.inv-dlg-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.inv-dlg-title { flex: 1; margin: 0; font-size: 18px; line-height: 1.3; font-weight: 700; }
.inv-dlg-close { flex: none; border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; color: #444; padding: 0 4px; }
.inv-dlg-close:hover, .inv-dlg-close:focus-visible { color: #000; outline: 2px solid #0a4c98; border-radius: 3px; }
.inv-evt-details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.inv-evt-details dt { font-weight: 600; color: #555; }
.inv-evt-details dd { margin: 0; }
.inv-evt-type { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 13px; }
.inv-evt-type-predavanje { background: rgb(54,162,235); }
.inv-evt-type-seminar { background: rgb(255,205,86); }
.inv-evt-type-vjezba { background: rgb(75,192,192); }
body.inv-dlg-open { overflow: hidden; }

/* ispis */
.inv-print-title { text-align: center; font-size: 20px; margin: 0 0 12px; }
body.inv-cal-print-page { margin: 0; padding: 12px; background: #fff; }
body.inv-cal-print-page .inv-raspored .fc .fc-toolbar-title { font-size: 18px; }
@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body.inv-cal-print-page { padding: 0; }
    .inv-raspored .fc-header-toolbar .fc-toolbar-chunk:first-child,
    .inv-raspored .fc-header-toolbar .fc-toolbar-chunk:last-child,
    .inv-raspored-msg, .inv-dlg, .inv-dlg-backdrop { display: none !important; }
    .inv-raspored .fc-v-event, .inv-raspored .fc-daygrid-event { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .inv-evt { font-size: 10px; }
    .inv-evt-time, .inv-evt-lecturer, .inv-evt-loc, .inv-evt-meta { font-size: 9px; }
}

/* mobilni */
@media (max-width: 1000px) {
    /* stari mobilni hakovi teme (horizontalni scroll od 1000 px, gradijenti, strelice) više nisu potrebni */
    .calendar-el-displ .fc-view-harness::before,
    .calendar-el-displ .fc-view-harness::after,
    .calendar-el-displ .fc-view-harness > i.fa-caret-left,
    .calendar-el-displ .fc-view-harness > i.fa-caret-right { display: none !important; }
    .calendar-el-displ .fc-view-harness > div { overflow-x: visible !important; }
    .calendar-el-displ .fc-view-harness > div > table { width: 100% !important; }
}
@media (max-width: 767px) {
    .inv-raspored .fc .fc-toolbar.fc-header-toolbar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
    .inv-raspored .fc .fc-toolbar-title { font-size: 16px; width: 100%; text-align: center; order: -1; }
    .inv-raspored .fc .fc-button { font-size: 13px; padding: 4px 8px; }
}
