/* Interactive university structure — classic top-down ORG CHART (MS-Office
   style boxes + connector lines), replacing the old static org-chart JPG/PDF.
   Collapsible, horizontally scrollable. Scoped .oc-* classes, brand #E32D44. */

:root { --oc-brand: #E32D44; --oc-line: #cfcfda; --oc-ink: #2b2b36; --oc-muted: #6a6a76; }

.struct-wrap { margin-top: 46px; margin-bottom: 72px; }

.struct-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 22px;
}
.struct-toolbar__btns { display: flex; gap: 10px; flex-wrap: wrap; }
.struct-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fff; border: 1px solid #e0e0e8; border-radius: 100px;
    padding: 8px 16px; font-size: 14px; color: var(--oc-muted); cursor: pointer;
    transition: border-color .18s, color .18s, background .18s;
}
.struct-btn:hover { border-color: var(--oc-brand); color: var(--oc-brand); background: rgba(227,45,68,.04); }
.struct-pdf {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--oc-brand); color: #fff; text-decoration: none;
    border-radius: 100px; padding: 9px 20px; font-size: 14px; font-weight: 600;
    transition: background .18s;
}
.struct-pdf:hover { background: #c8253a; color: #fff; text-decoration: none; }

/* zoom control */
.struct-zoom { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid #e0e0e8; border-radius: 100px; padding: 4px; }
.struct-zoom__btn {
    width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent;
    color: var(--oc-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.struct-zoom__btn:hover { background: rgba(227,45,68,.08); color: var(--oc-brand); }
.struct-zoom__level {
    min-width: 52px; text-align: center; border: none; background: transparent;
    font-size: 13.5px; color: var(--oc-ink); cursor: pointer; padding: 0 2px; font-variant-numeric: tabular-nums;
}
.struct-zoom__level:hover { color: var(--oc-brand); }

/* scroll/pan viewport */
.oc-viewport {
    overflow: auto;
    border: 1px solid #ececf0;
    border-radius: 18px;
    background:
        radial-gradient(circle at 1px 1px, #e7e7ee 1px, transparent 0) 0 0 / 22px 22px,
        #fbfbfd;
    padding: 40px 30px 34px;
    -webkit-overflow-scrolling: touch;
}
.oc { display: inline-block; min-width: 100%; }

/* ---- tree rows ---- */
.oc ul { position: relative; padding-top: 26px; display: flex; justify-content: center; margin: 0; list-style: none; }
.oc-root { padding-top: 0 !important; }
.oc li {
    position: relative; padding: 26px 12px 0; display: flex; flex-direction: column; align-items: center;
}

/* connector lines (classic CSS org chart) */
.oc li::before, .oc li::after {
    content: ''; position: absolute; top: 0; right: 50%;
    width: 50%; height: 26px; border-top: 2px solid var(--oc-line);
}
.oc li::after { right: auto; left: 50%; border-left: 2px solid var(--oc-line); }
.oc li:only-child::before, .oc li:only-child::after { display: none; }
.oc li:only-child { padding-top: 26px; }
.oc li:first-child::before, .oc li:last-child::after { border: 0 none; }
.oc li:last-child::before { border-right: 2px solid var(--oc-line); border-radius: 0 7px 0 0; }
.oc li:first-child::after { border-radius: 7px 0 0 0; }
/* vertical drop from a parent down to its children row */
.oc ul ul::before, .oc-root ul::before, .oc li > ul::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-1px);
    width: 0; height: 26px; border-left: 2px solid var(--oc-line);
}
.oc-root > li::before, .oc-root > li::after { display: none; }
.oc-root > li { padding-top: 0; }

/* collapsed: hide the children row and its drop line */
.oc li.collapsed > ul { display: none; }

/* ---- node box ("balloon") ---- */
.oc-node {
    position: relative;
    display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
    min-width: 148px; max-width: 232px;
    background: #fff; border: 1px solid #e2e2ec; border-radius: 13px;
    padding: 13px 18px; text-align: center;
    box-shadow: 0 5px 16px rgba(30,20,40,.07);
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.oc-node:hover { box-shadow: 0 12px 26px rgba(30,20,40,.13); transform: translateY(-2px); border-color: #d3d3e0; }
.oc-node__label { color: var(--oc-ink); font-size: 14px; line-height: 1.4; text-decoration: none; }
a.oc-node__label { color: var(--oc-brand); }
a.oc-node__label:hover { text-decoration: underline; }
.oc-node__note { color: var(--oc-muted); font-size: 12px; line-height: 1.35; }

/* depth accents */
.oc-node.depth-0 {
    background: linear-gradient(120deg, #a8122c, var(--oc-brand));
    border: none; box-shadow: 0 12px 26px rgba(227,45,68,.28); min-width: 210px;
}
.oc-node.depth-0 .oc-node__label { color: #fff; font-size: 15.5px; font-weight: 700; }
.oc-node.depth-0 .oc-node__note { color: rgba(255,255,255,.85); }
.oc-node.depth-1 { border-top: 3px solid var(--oc-brand); }
.oc-node.depth-2 { border-top: 3px solid #f0a5af; }

/* expand / collapse button, sitting on the bottom edge of the box */
.oc-toggle {
    position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%);
    width: 24px; height: 24px; border-radius: 50%;
    border: 2px solid #fff; background: var(--oc-brand); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px; line-height: 1; cursor: pointer; padding: 0; z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.oc-toggle:hover { background: #c8253a; }
.oc-toggle .oc-toggle__plus { display: none; }
.oc li.collapsed > .oc-node .oc-toggle__plus { display: inline; }
.oc li.collapsed > .oc-node .oc-toggle__minus { display: none; }
.oc-toggle__count {
    position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%);
    font-size: 11px; color: var(--oc-muted); white-space: nowrap; display: none;
}
.oc li.collapsed > .oc-node .oc-toggle__count { display: block; }

.oc-scroll-hint { text-align: center; color: #b3b3bd; font-size: 12.5px; margin-top: 10px; }

@media (max-width: 575px) {
    .oc-viewport { padding: 24px 14px; }
    .oc-node { min-width: 128px; padding: 11px 13px; }
    .oc-node__note { display: none; }
}
