/* <!-- CSS KUSTOM DENGAN PENYESUAIAN RESPONSIVE --> */
:root {
    --main-line-height: 220px;
}

body {
    font-family: "Poppins", sans-serif;
    background-color: #f4f7f6;
}

.judul-utama h1 {
    display: inline-block;
}

/* PERUBAHAN 1: KONTAINER UTAMA UNTUK SCROLLING & ZOOM */
.chart-container {
    text-align: center;
    overflow-x: auto;
    /* <-- KUNCI untuk scroll horizontal */
    padding: 20px;
    /* Memberikan efek scrolling yang lebih mulus di perangkat iOS */
    -webkit-overflow-scrolling: touch;
}

/* CARD STYLING (Tidak berubah) */
.card-struktur {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    padding: 15px;
    min-width: 120px;
    max-width: 140px;
    transition: transform 0.3s, box-shadow 0.3s;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-struktur:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-struktur .card-img-top img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f8c146;
    margin-bottom: 10px;
}

.card-struktur .nama {
    font-size: 0.5rem;
    font-weight: 100;
    color: #333;
    margin: 0;
}

.card-struktur .jabatan {
    font-size: 0.3rem;
    color: #666;
    margin: 0;
}

.chart-container a {
    text-decoration: none;
}

/* STRUKTUR LAYOUT & GARIS HIERARKI (TIDAK BANYAK BERUBAH) */
.chart-area {
    position: relative;
    display: inline-block;
    /* PERUBAHAN 2: Menambahkan transisi dan origin untuk zoom */
    transform-origin: top center;
    transition: transform 0.3s ease;
}

/* PERUBAHAN 3: Media Query untuk Tampilan Tablet & Mobile */
@media (max-width: 1024px) {
    .chart-area {
        /* "Paksa" bagan agar tetap lebar, ini akan mengaktifkan overflow-x */
        min-width: 1400px;
    }
}

.level-kepala {
    position: relative;
    display: inline-block;
    z-index: 2;
}

.level-kepala::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: 2px;
    height: var(--main-line-height);
    background-color: #f8c146;
    z-index: 1;
}

.grup-sekretaris {
    position: absolute;
    top: 80px;
    left: calc(50% + 150px);
    z-index: 2;
}

.grup-kabid {
    position: relative;
    z-index: 2;
}

.grup-kabid > ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 20px;
    position: relative;
}

.grup-kabid > ul::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background-color: #f8c146;
    z-index: 1;
}

/* LOGIKA GARIS (SAMA SEPERTI SEBELUMNYA) */
.chart-area ul {
    padding: 0;
    position: relative;
}

.chart-area ul,
.chart-area li {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.chart-area li {
    display: inline-block;
    text-align: center;
    position: relative;
    padding: 20px 5px 0 5px;
}

.grup-sekretaris > ul > li::before {
    content: "";
    position: absolute;
    top: 30%;
    transform: translateY(-50%);
    right: 100%;
    width: 150px;
    height: 2px;
    background-color: #f8c146;
}

.grup-kabid > ul > li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background-color: #f8c146;
}

.chart-area li > a {
    position: relative;
    display: flex;
    height: 100%;
}

.grup-kabid > ul > li > a {
    height: 50%;
}

.chart-area li > ul {
    padding-top: 20px;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.chart-area li:has(> ul) > a::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background-color: #f8c146;
}

.chart-area li > ul::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background-color: #f8c146;
    z-index: 1;
}

.chart-area li > ul > li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background-color: #f8c146;
}

.chart-area li > ul:has(> li:only-child)::before {
    display: none;
}

/* TAMBAHAN 4: CSS untuk Tombol Zoom */
.zoom-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.zoom-controls button {
    background-color: #f8c146;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    margin-top: 10px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

.zoom-controls button:hover {
    background-color: #e0ac2e;
}
