/* Album web app - page chrome. Colors come from the sc-extension-theme.css variables so both themes work
 * (same rule as AI_Magic magic-page.css). */

/* ---------- Header ---------- */

.album-header .webix_template { overflow: hidden; }
.album-brand-box {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 4px 6px 12px; height: 100%;
}
.album-brand-box img { height: 32px; width: 32px; }
.album-brand-title { font-size: 17px; font-weight: 700; line-height: 1.2; color: var(--text-primary); white-space: nowrap; }
.album-brand-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.album-user-cell .webix_template {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px; height: 100%;
}
.album-user-btn, .album-icon-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary); color: var(--text-primary);
    font: inherit; font-size: 13px; white-space: nowrap;
}
.album-icon-btn { padding: 6px 9px; }
.album-user-btn:hover, .album-icon-btn:hover { background: var(--hover-bg); }
.album-user-name { font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.album-pill {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    padding: 2px 7px; border-radius: 9px; letter-spacing: .04em;
    border: 1px solid var(--border-color); color: var(--text-secondary); white-space: nowrap;
}
.album-pill-admin { border-color: var(--sc-accent-dark); color: var(--sc-accent-dark); }

/* ---------- Sign-in page ---------- */

.album-login-wrap { background: var(--bg-primary); }
.album-login-card { border: 1px solid var(--border-color) !important; border-radius: 10px; }
.album-login-head { display: flex; align-items: center; gap: 10px; padding: 14px 4px 4px; }
.album-login-head img { height: 32px; }
.album-login-head span { font-size: 18px; font-weight: 600; color: var(--text-primary); }
/* Every checkbox row lies on the background of whatever holds it: the theme frames the whole row (square and label)
   in a white box; only the square keeps its own frame. The theme rule carries !important and the shared theme file is
   not edited, so this override needs !important and one more class to win. */
.webix_el_checkbox .webix_el_box .webix_inp_checkbox_border { background: transparent !important; border: 0 !important; }

.album-error { color: var(--accent-danger); font-size: 13px; }
.album-dim   { color: var(--text-muted); font-size: 13px; }

/* ---------- Page head (sticky first row of a page, as in AI_TTS_Server ui-page-layout) ---------- */

.album-page-head { padding: 4px 8px 0; }
.album-page-head h2 { margin: 8px 0 2px; font-size: 20px; color: var(--text-primary);
                      display: flex; align-items: center; gap: 8px; }
/* Some sci glyphs sit on combining code points (face_recognition is U+0618) and get no advance width of their own */
.album-page-head h2 .sci, .webix_win_head .sci { width: 1.1em; flex: none; }
.album-page-head .album-lead { color: var(--text-secondary); font-size: 13px; margin: 0 0 6px; }

/* ---------- Face groups ---------- */

.album-face-mini { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; display: block; margin-top: 5px;
                   background: var(--bg-tertiary); }
.album-group-name { font-weight: 600; color: var(--text-primary); line-height: 18px; padding-top: 10px;
                    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-group-new { font-style: italic; color: var(--text-muted); font-weight: 400; }
.album-group-sub { font-size: 12px; line-height: 16px; color: var(--text-muted); white-space: nowrap; }
.album-num { text-align: right; }

.album-status { font-size: 11px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--border-color);
                color: var(--text-secondary); white-space: nowrap; }
.album-status-confirmed { border-color: var(--accent-success); color: var(--accent-success); }
.album-status-rejected { border-color: var(--accent-danger); color: var(--accent-danger); }
.album-status-split { border-color: var(--accent-warning); color: var(--accent-warning); }

.album-detail-head { padding: 8px 10px 4px; color: var(--text-primary); }
.album-detail-title { font-size: 16px; font-weight: 600; }
.album-detail-line { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.album-detail-line b { color: var(--text-primary); }
.album-empty { display: flex; align-items: center; justify-content: center; height: 100%;
               color: var(--text-muted); text-align: center; padding: 20px; box-sizing: border-box; }

.album-face-card { position: relative; height: 100%; text-align: center; padding-top: 4px; box-sizing: border-box; }
.album-face-card img { width: 100%; aspect-ratio: 1; height: auto; border-radius: 8px; object-fit: cover;
                       display: block; margin: 0 auto; background: var(--bg-tertiary); }
.album-face-cap { font-size: 12px; color: var(--text-muted); margin-top: 3px; white-space: nowrap; overflow: hidden;
                  text-overflow: ellipsis; padding: 0 2px; }
.album-face-cap b { color: var(--text-primary); font-weight: 600; }
.album-face-open {
    position: absolute; top: 8px; right: 4px; width: 26px; height: 26px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border-color);
    opacity: .9; font-size: 16px;
}
.album-face-open:hover { background: var(--hover-bg); }
.album-face-check { position: absolute; top: 8px; left: 4px; font-size: 20px; color: var(--sc-accent-dark);
                    display: none; background: var(--bg-primary); border-radius: 4px; line-height: 20px; }
.album-split .webix_selected .album-face-check { display: block; }
.album-split .webix_selected .album-face-card img { outline: 3px solid var(--sc-accent-dark); outline-offset: -3px; }
.album-split .webix_dataview_item { cursor: pointer; }

.album-menu-item { display: flex; align-items: center; gap: 10px; }
.album-menu-item .sci { width: 1.2em; flex: none; font-size: 18px; }

/* ---------- Photos page ---------- */

.album-photos { padding: 0 8px 16px; }
.album-month { font-size: 15px; font-weight: 600; color: var(--text-primary); padding: 14px 2px 6px; }
.album-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.album-tile { position: relative; aspect-ratio: 1; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden;
              cursor: pointer; }
.album-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-tile-broken img { display: none; }
.album-tile-broken::after { content: "файл повреждён"; position: absolute; inset: 0; display: flex; align-items: center;
                            justify-content: center; font-size: 12px; color: var(--text-muted); }
.album-tile-video { display: flex; align-items: center; justify-content: center; background: #2c3e2e; color: #f5fff2; }
.album-tile-video .sci { font-size: 44px; opacity: .9; }
.album-tile-time { position: absolute; right: 6px; bottom: 4px; font-size: 12px; }
.album-photos-end { height: 40px; }
.album-photos-done { height: 8px; }
@media (max-width: 760px) {
    .album-tiles { grid-template-columns: repeat(3, 1fr); gap: 2px; }
}

.album-viewer-body { position: relative; }
.album-viewer-body .webix_template { height: 100%; display: flex; flex-direction: column; }
.album-viewer-media { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.album-viewer-media .album-photo-wrap { margin: 0; }
.album-viewer-media img { display: block; max-width: calc(100vw - 40px); max-height: calc(100vh - 160px); }
.album-viewer-media video { max-width: calc(100vw - 40px); max-height: calc(100vh - 160px); background: #000; }
.album-viewer-boxes { position: absolute; inset: 0; pointer-events: none; }
.album-viewer-cap { padding: 6px 12px 8px; font-size: 14px; line-height: 20px; text-align: center; color: var(--text-primary); }
.album-viewer-novideo { text-align: center; line-height: 24px; color: var(--text-primary); }
.album-viewer-novideo a { color: var(--accent-info); }
.album-viewer-prev, .album-viewer-next {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 64px; border: 0;
    border-radius: 8px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 30px; cursor: pointer;
}
.album-viewer-prev { left: 8px; }
.album-viewer-next { right: 8px; }
.album-viewer-prev:hover, .album-viewer-next:hover { background: rgba(0, 0, 0, .7); }
.album-viewer-count { font-size: 14px; }
.album-icon-btn.album-btn-on { background: var(--sc-accent); }

/* ---------- Person chooser ---------- */

.album-person-row { display: flex; align-items: center; gap: 10px; height: 100%; }
.album-person-row img, .album-person-noface { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; flex: none;
                                              background: var(--bg-tertiary); }
.album-person-noface { display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text-muted); }
.album-person-name { flex: 1; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis;
                     white-space: nowrap; }
.album-section-cap { padding: 8px 0 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
                     color: var(--text-secondary); border-top: 1px solid var(--border-color); }

/* ---------- Places ---------- */

/* Leaflet's own panes and controls use z-index up to 1000; the map gets its own stacking context so that Webix
   dialogs stay above it */
.album-map { width: 100%; height: 100%; position: relative; z-index: 0; isolation: isolate; }
.album-coord-cap { font-size: 11px; }
.album-city-row { line-height: 20px; padding-top: 4px; }
.album-city-row .album-person-name { display: block; }
.album-photo-card { cursor: pointer; }

/* ---------- Objects ---------- */

.album-object-mini { width: 60px; height: 44px; border-radius: 6px; object-fit: cover; display: block; margin-top: 5px;
                     background: var(--bg-tertiary); }
.album-object-crop { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--bg-tertiary);
                     display: flex; align-items: center; justify-content: center; overflow: hidden; }
.album-object-crop img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.album-plate-row { display: flex; gap: 4px; justify-content: center; margin-top: 2px; }
.album-plate-mini { height: 22px; max-width: 70px; object-fit: contain; border: 1px solid var(--border-color); border-radius: 3px;
                    background: var(--bg-tertiary); }
.album-split .webix_selected .album-object-crop { outline: 3px solid var(--sc-accent-dark); outline-offset: -3px; }

/* ---------- Accounts ---------- */

.album-acc-name { font-weight: 600; color: var(--text-primary); line-height: 18px; padding-top: 5px;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Photo window ---------- */

.album-photo-body { text-align: center; background: var(--bg-tertiary); }
.album-photo-wrap { position: relative; display: inline-block; margin-top: 6px; }
.album-photo-wrap img { display: block; max-width: calc(100vw - 40px); max-height: calc(100vh - 150px); }
.album-face-box { position: absolute; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5);
                  box-sizing: border-box; }
.album-face-box.album-face-current { border: 3px solid #ffd54f; box-shadow: 0 0 0 1px rgba(0, 0, 0, .7); }
.album-face-label { position: absolute; left: -2px; top: 100%; margin-top: 2px; font-size: 11px; white-space: nowrap;
                    background: rgba(0, 0, 0, .65); color: #fff; padding: 0 4px; border-radius: 3px; }
.album-photo-cap { font-size: 12px; color: var(--text-muted); padding: 4px 0 6px; }
