/*
  File role: VOGO chat (rag-ai) — the open conversation's "Media" screen (media.js; user, 27.10.2026, like WhatsApp's
  "All media"): tabs Documente / Linkuri / Media, groups by calendar days (Azi, Ieri, rest), first group expanded.
  The whole screen on the phone, a large centred panel on the laptop; under the picture preview (.preview, z 110).
  The chat's tokens give the light and the dark theme; the icons in the VOGO blue (VOGO icons style).
  @file_version 1.0.4 (01.11.2026: the local path copies on a tap — pointer, clipboard icon, green when copied; 1.0.3: the
  file's local path, small, under each document)
*/
.media-screen { position: fixed; inset: 0; z-index: 107; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 16, .45); }
.media-screen[hidden] { display: none; }
.media-panel { display: flex; flex-direction: column; width: min(760px, calc(100vw - 32px)); height: min(86vh, 900px);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }

/* The head: back arrow, the title and the conversation's name under it */
.media-head { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 6px 12px 6px 6px; background: var(--panel); }
.media-back { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--fg); font-size: 22px; cursor: pointer; }
.media-back:hover { background: var(--code); }
.media-title { min-width: 0; }
.media-title h2 { margin: 0; font-size: 19px; font-weight: 700; color: var(--fg); }
.media-conv { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The tabs, the current one underlined in the VOGO blue */
.media-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--panel); border-bottom: 1px solid var(--line); }
.media-tabs button { height: 48px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.media-tabs button.on { color: var(--fg); border-bottom-color: var(--vogo-icon-blue); }

.media-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: 16px; }
.media-group { margin: 0; padding: 18px 16px 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.media-note { margin: 0; padding: 32px 16px; text-align: center; color: var(--muted); }
.media-foot { margin: 8px 16px 0; font-size: 12.5px; color: var(--muted); }

/* The pictures: square tiles, 3 a row on the phone, 5 on the laptop */
.media-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.media-thumb { position: relative; aspect-ratio: 1 / 1; padding: 0; border: 0; background: var(--code); cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--vogo-icon-blue); font-size: 26px; }
.media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-thumb-gone { opacity: .45; }
/* 1.0.2 (30.10.2026): an audio file in the Media tab — the music icon and its name, no picture to load. */
.media-audio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; }
.media-audio .bi { font-size: 26px; color: var(--acc); }
.media-audio-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px;
  color: var(--muted, #8a94a6); }

/* The documents and the links: one row each, icon, name, details, the action on the right */
.media-list { display: flex; flex-direction: column; background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.media-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 62px; padding: 8px 16px; border: 0;
  border-top: 1px solid var(--line); background: transparent; color: var(--fg); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.media-row:first-child { border-top: 0; }
.media-row:hover { background: var(--code); }
.media-row > .bi { flex: none; font-size: 24px; color: var(--vogo-icon-blue); }
.media-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.media-row-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-row-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the file's local path, small, under the size and date (user, 01.11.2026); a tap copies it (media.js copyPath) */
.media-row-path { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 11px; color: var(--muted);
  opacity: .85; cursor: pointer; }
.media-row-path-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-row-path .bi { flex: none; font-size: 11px; color: var(--vogo-icon-blue); }
.media-row-path:hover { opacity: 1; color: var(--fg); }
.media-row-path.copied, .media-row-path.copied .bi { opacity: 1; color: var(--ok); }
.media-row > .media-row-action { font-size: 18px; color: var(--muted); }

@media (max-width: 600px) {
  .media-screen { background: var(--bg); }
  .media-panel { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Collapsible group headers (user, 27.10.2026: calendar days Azi, Ieri, etc., first group expanded by default) */
.media-group { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.media-group:hover { background: var(--code); }
.media-group-icon { display: inline-block; width: 20px; text-align: center; font-size: 12px; color: var(--muted); }
