/* ============================================================
   assets/mahasiswa.css — Halaman Mahasiswa
   Style spesifik mahasiswa. Page banner, section-head-split,
   dokumen-table, loading-state, spinner di-reuse dari style
   yang sudah ada (header.php, kurikulum.css, dosen.css, alumni.css).
   ============================================================ */

/* ============ PAGE BANNER (Hero) ============ */
.page-banner {
    background: var(--navy);
    color: #fff;
    padding: 60px 0 50px;
    border-bottom: 4px solid var(--accent);
}
.page-banner .container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}
.page-banner .breadcrumb { font-size: 13px; color: rgba(255, 255, 255, 0.75); margin-bottom: 14px; }
.page-banner .breadcrumb a { color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.page-banner .breadcrumb a:hover { color: var(--accent); }
.page-banner h1 {
    font-family: 'Source Serif 4', serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.15;
    max-width: 720px;
}
.page-banner .lede { color: rgba(255, 255, 255, 0.85); max-width: 540px; font-size: 15px; margin-top: 12px; }
.page-banner-meta { font-size: 12px; color: rgba(255, 255, 255, 0.65); text-align: right; }
.page-banner-meta strong {
    display: block;
    color: var(--accent);
    font-size: 28px;
    font-family: 'Source Serif 4', serif;
    font-weight: 700;
}
@media (max-width: 720px) {
    .page-banner { padding: 40px 0 36px; }
    .page-banner h1 { font-size: 32px; }
    .page-banner-meta { text-align: left; }
    .page-banner-meta strong { font-size: 22px; }
}


/* ============ SECTION DEFAULTS override ============ */
#mahasiswa { background: var(--soft); }
#mahasiswa .section-head { margin-bottom: 28px; }
#mahasiswa .section-desc {
    margin-top: -32px;
    margin-bottom: 32px;
    max-width: 760px;
}

/* ============================================================
   STATS ROW — 4 kartu ringkasan (pola sama dengan alumni.css)
   ============================================================ */
.mhs-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 0 0 48px;
}
.mhs-stat {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 12px;
    padding: 22px 22px 20px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.mhs-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 35, 70, 0.10);
}
.mhs-stat-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.mhs-stat-value {
    display: block;
    font-family: 'Source Serif 4', serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.1;
}
.mhs-stat-value small {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
}

/* ============================================================
   GRAFIK CARD — pembungkus Chart.js (line + donut)
   ============================================================ */
.mhs-chart-card {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 12px;
    padding: 26px 28px 24px;
    box-shadow: 0 2px 8px rgba(15, 35, 70, 0.04);
    margin: 0 0 36px;
}
.mhs-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.mhs-chart-title {
    font-family: 'Source Serif 4', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 4px;
}
.mhs-chart-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}
/* Legend chips (pengganti legend default Chart.js) */
.mhs-chart-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}
.mhs-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}
.mhs-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}
.mhs-legend-dot.akademik   { background: var(--navy); }
.mhs-legend-dot.nonakademik { background: var(--accent); }
.mhs-legend-dot.masuk       { background: var(--navy); }
.mhs-legend-dot.lulus       { background: var(--accent); }

.mhs-chart-wrap {
    position: relative;
    width: 100%;
    height: 320px;
}
@media (max-width: 640px) {
    .mhs-chart-card { padding: 18px 18px 16px; }
    .mhs-chart-wrap { height: 280px; }
}

/* ============================================================
   LAYOUT 2-KOLOM: Tabel + Donut
   ============================================================ */
.mhs-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 900px) {
    .mhs-row { grid-template-columns: 1fr; }
}

/* ============================================================
   DONUT CARD (penyebaran mhs baru per tahun)
   ============================================================ */
.mhs-donut-card {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 12px;
    padding: 22px 24px 24px;
    box-shadow: 0 2px 8px rgba(15, 35, 70, 0.04);
}
.mhs-donut-wrap {
    position: relative;
    width: 100%;
    height: 280px;
    margin-top: 12px;
}
.mhs-donut-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.mhs-donut-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text);
}
.mhs-donut-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}
.mhs-donut-year {
    font-weight: 600;
    color: var(--navy);
    font-family: 'Source Serif 4', serif;
}
.mhs-donut-val {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-weight: 500;
}
.mhs-donut-pct {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}
@media (max-width: 640px) {
    .mhs-donut-card { padding: 18px 18px 18px; }
    .mhs-donut-wrap { height: 240px; }
}

/* ============================================================
   TABEL STATISTIK — rekap per tahun (5 kolom saja)
   ============================================================ */
.mhs-table-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 35, 70, 0.04);
}
.mhs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.mhs-table thead {
    background: var(--navy);
    color: #fff;
}
.mhs-table th {
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    border-bottom: 3px solid var(--accent);
}
.mhs-table th:first-child { text-align: left; }
.mhs-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.mhs-table td:first-child {
    font-family: 'Source Serif 4', serif;
    font-weight: 700;
    color: var(--navy);
    text-align: left;
}
.mhs-table tbody tr:last-child td { border-bottom: 0; }
.mhs-table tbody tr:nth-child(even) { background: var(--soft); }
.mhs-table tbody tr:hover td { background: rgba(249, 115, 22, 0.06); }
.mhs-table td.mhs-zero { color: var(--text-muted); opacity: .5; }

/* ============================================================
   KEGIATAN SECTION
   ============================================================ */
#kegiatan { background: var(--bg); }
#kegiatan .section-desc {
    margin-top: -32px;
    margin-bottom: 32px;
    max-width: 760px;
}

/* Grid kartu kegiatan */
.kegiatan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Kartu */
.kegiatan-card {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    display: flex;
    flex-direction: column;
}
.kegiatan-card:hover {
    transform: translateY(-4px);
    border-top-color: var(--accent);
    box-shadow: 0 12px 32px rgba(15, 35, 70, 0.10);
}

/* Frame foto */
.kegiatan-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
    overflow: hidden;
}
.kegiatan-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.kegiatan-card:hover .kegiatan-img-wrap img { transform: scale(1.04); }

/* Tag tanggal di pojok foto */
.kegiatan-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--accent);
    color: var(--navy-deep);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    padding: 5px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Body kartu */
.kegiatan-body {
    padding: 20px 22px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kegiatan-date {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: .04em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.kegiatan-date svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: var(--accent-dark);
}
.kegiatan-title {
    font-family: 'Source Serif 4', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.3;
    margin: 0;
}
.kegiatan-card:hover .kegiatan-title { color: var(--accent-dark); }

/* Tombol lihat foto */
.kegiatan-action {
    margin-top: auto;
    padding-top: 12px;
}
.kegiatan-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--navy);
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all .18s ease;
}
.kegiatan-link:hover {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    transform: translateY(-1px);
}
.kegiatan-link svg { width: 13px; height: 13px; flex-shrink: 0; }

/* State messages */
.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.error-state { color: var(--accent-dark); }
.empty-state { font-style: italic; }
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .mhs-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .mhs-stat-value { font-size: 26px; }

    .kegiatan-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    .kegiatan-title { font-size: 16px; }
}

@media (max-width: 640px) {
    .mhs-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 32px;
    }
    .mhs-stat { padding: 16px 14px; }
    .mhs-stat-value { font-size: 22px; }
    .mhs-stat-label { font-size: 10.5px; }

    .kegiatan-grid { grid-template-columns: 1fr; gap: 16px; }
    .kegiatan-body { padding: 16px 18px 18px; }
    .kegiatan-title { font-size: 16px; }

    /* Tabel: tampilkan scroll horizontal di layar kecil */
    .mhs-table-wrap { overflow-x: auto; }
    .mhs-table { min-width: 520px; }
}

/* ============================================================
   Album Modal — overlay panel dengan grid foto
   ============================================================ */
.album-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.album-modal.is-open {
    display: flex;
    animation: album-fade-in 0.22s ease-out;
}
.album-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.album-panel {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 960px;
    max-height: 88vh;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: album-pop-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes album-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes album-pop-in {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.album-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--border, #E2E8F0);
    background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
}
.album-header-text { flex: 1; min-width: 0; }
.album-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent, #F97316);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}
.album-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--navy, #1E3A8A);
    margin: 0 0 6px;
    line-height: 1.3;
    word-wrap: break-word;
}
.album-count {
    font-size: 12.5px;
    color: var(--text-muted, #64748B);
    margin: 0;
    font-weight: 500;
}
.album-close {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #F1F5F9;
    color: var(--navy, #1E3A8A);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.album-close svg { width: 20px; height: 20px; }
.album-close:hover { background: var(--navy, #1E3A8A); color: #fff; transform: rotate(90deg); }

.album-desc {
    padding: 16px 28px 18px;
    font-size: 14.5px;
    line-height: 1.65;
    color: #334155;
    border-bottom: 1px solid var(--border, #E2E8F0);
    max-height: 120px;
    overflow-y: auto;
}

/* Loading state */
.album-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 60px 20px;
    color: var(--text-muted, #64748B);
    font-size: 14px;
}
.album-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid #E2E8F0;
    border-top-color: var(--navy, #1E3A8A);
    border-radius: 50%;
    animation: album-spin 0.8s linear infinite;
}
@keyframes album-spin { to { transform: rotate(360deg); } }

/* Error state */
.album-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: #DC2626;
    text-align: center;
}
.album-error svg { width: 44px; height: 44px; }
.album-error p { margin: 0; }
.album-error p:last-child { color: #64748B; }

/* Grid foto */
.album-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px 28px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    align-content: start;
}
.album-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted, #64748B);
    font-size: 14px;
}

.album-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    border: none;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #F1F5F9;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
}
.album-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.album-thumb:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(15, 30, 71, 0.18);
}
.album-thumb:hover img { transform: scale(1.08); }
.album-thumb:focus-visible {
    outline: 3px solid var(--accent, #F97316);
    outline-offset: 3px;
}
.album-thumb.is-broken {
    background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 8px, #e2e8f0 8px, #e2e8f0 16px);
}
.album-thumb.is-broken::after {
    content: 'foto tidak dapat dimuat';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #94A3B8;
    text-align: center;
    padding: 4px;
}

/* Tooltip "Klik untuk lihat album" — muncul saat hover/focus di card */
.kegiatan-card.is-clickable { cursor: pointer; }
.kegiatan-card.is-clickable:focus-visible {
    outline: 3px solid var(--accent, #F97316);
    outline-offset: 3px;
}

.kegiatan-tooltip {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translate(-50%, 8px);
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s, transform 0.22s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.kegiatan-tooltip-icon { display: inline-flex; }
.kegiatan-tooltip svg { width: 16px; height: 16px; }

.kegiatan-card.is-clickable:hover .kegiatan-tooltip,
.kegiatan-card.is-clickable:focus-visible .kegiatan-tooltip,
.kegiatan-card.is-clickable:focus-within .kegiatan-tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ============================================================
   Lightbox — foto individual
   ============================================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.92);
}
.lightbox.is-open {
    display: flex;
    animation: album-fade-in 0.2s ease-out;
}
.lightbox-figure {
    position: relative;
    max-width: 95vw;
    max-height: 92vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.lightbox-figure img {
    max-width: calc(100vw - 140px);
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.lightbox-figure figcaption {
    color: #fff;
    font-size: 13.5px;
    text-align: center;
    opacity: 0.92;
    max-width: 90vw;
}
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}
.lightbox-close svg { width: 22px; height: 22px; }
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* Tombol navigasi kiri/kanan di lightbox */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    z-index: 2;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-50%) scale(1.08);
}
.lightbox-nav:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}
.lightbox-nav-prev  { left: 16px; }
.lightbox-nav-prev:hover:not(:disabled) { transform: translateY(-50%) translateX(-3px) scale(1.08); }
.lightbox-nav-next  { right: 16px; }
.lightbox-nav-next:hover:not(:disabled) { transform: translateY(-50%) translateX(3px) scale(1.08); }

/* Responsif */
@media (max-width: 720px) {
    .album-modal { padding: 0; }
    .album-panel {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .album-header { padding: 18px 18px 12px; }
    .album-title { font-size: 18px; }
    .album-desc { padding: 12px 18px 14px; max-height: 90px; font-size: 13.5px; }
    .album-grid {
        padding: 14px 14px 20px;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    .album-close { width: 34px; height: 34px; }

    .lightbox-nav { width: 40px; height: 40px; }
    .lightbox-nav svg { width: 18px; height: 18px; }
    .lightbox-nav-prev { left: 8px; }
    .lightbox-nav-next { right: 8px; }
    .lightbox-figure img { max-width: calc(100vw - 100px); }
}

/* Scrollbar styling untuk area scroll di modal */
.album-grid::-webkit-scrollbar,
.album-desc::-webkit-scrollbar { width: 8px; }
.album-grid::-webkit-scrollbar-track,
.album-desc::-webkit-scrollbar-track { background: #F8FAFC; }
.album-grid::-webkit-scrollbar-thumb,
.album-desc::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
.album-grid::-webkit-scrollbar-thumb:hover,
.album-desc::-webkit-scrollbar-thumb:hover { background: #94A3B8; }