/* Struktur Organisasi Diagram CSS */

.org-chart-container {
    padding: 30px 15px;
    overflow-x: auto;
}

.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: fit-content;
    margin: 0 auto;
}

/* Box Jabatan */
.org-box {
    background: white;
    border: 3px solid #2d5016;
    border-radius: 8px;
    padding: 15px;
    min-width: 180px;
    max-width: 180px;
    min-height: 200px;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.org-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(45, 80, 22, 0.25);
    border-color: #d4af37;
}

.org-box.pimpinan {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c2c 100%);
    color: white;
    font-weight: bold;
    border-color: #d4af37;
}

.org-box.wakil {
    background: linear-gradient(135deg, #4a7c2c 0%, #5a9c3c 100%);
    color: white;
    font-weight: bold;
    border-color: #d4af37;
}

/* Foto Pejabat */
.org-box-photo {
    width: 80px;
    height: 120px;
    margin: 0 auto 12px;
    border-radius: 6px;
    overflow: hidden;
    border: 3px solid #d4af37;
    background: #f5f5f5;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.org-box-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.org-box.pimpinan .org-box-photo,
.org-box.wakil .org-box-photo {
    border-color: #d4af37;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.org-box-title {
    font-weight: 700;
    font-size: 0.75rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    line-height: 1.3;
    word-wrap: break-word;
}

.org-box-name {
    font-size: 0.7rem;
    opacity: 0.9;
    line-height: 1.3;
    word-wrap: break-word;
}

/* Level Rows */
.org-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.org-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.org-row-secondary {
    margin-top: 15px;
}

/* Item Wrapper for Parent-Child */
.org-item-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Children Container */
.org-children {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px dashed #2d5016;
}

/* Child Item Wrapper (for Level 4 with sub-children) */
.org-child-item-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Child Box (Level 4 - Unsur Pelaksana) */
.org-box-child {
    min-width: 140px;
    max-width: 140px;
    min-height: 160px;
    padding: 10px;
    background: #f8f9fa;
    border: 2px solid #6aac4c;
    font-size: 0.85rem;
}

.org-box-child .org-box-photo {
    width: 60px;
    height: 90px;
    border-width: 2px;
}

.org-box-child .org-box-title {
    font-size: 0.65rem;
}

.org-box-child .org-box-name {
    font-size: 0.6rem;
}

.org-box-child:hover {
    transform: translateY(-3px);
    border-color: #d4af37;
}

/* Sub-children Container (Level 5 - Anggota) */
.org-sub-children {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #6aac4c;
}

/* Sub-child Box (Level 5 - Anggota) */
.org-box-sub-child {
    min-width: 120px;
    max-width: 120px;
    min-height: 140px;
    padding: 8px;
    background: #ffffff;
    border: 2px solid #8bc34a;
    font-size: 0.8rem;
}

.org-box-sub-child .org-box-photo {
    width: 50px;
    height: 75px;
    border-width: 2px;
}

.org-box-sub-child .org-box-title {
    font-size: 0.6rem;
}

.org-box-sub-child .org-box-name {
    font-size: 0.55rem;
}

.org-box-sub-child:hover {
    transform: translateY(-2px);
    border-color: #d4af37;
}

/* Garis Penghubung */
.org-connector {
    width: 3px;
    height: 30px;
    background: linear-gradient(180deg, #2d5016 0%, #4a7c2c 100%);
    margin: 0 auto;
    border-radius: 2px;
}

.org-connector-horizontal {
    height: 3px;
    background: linear-gradient(90deg, #2d5016 0%, #4a7c2c 100%);
    flex: 1;
    border-radius: 2px;
}

/* Label Level */
.level-label-wrapper {
    text-align: center;
    margin-bottom: 10px;
}

.level-label {
    background: linear-gradient(135deg, #d4af37 0%, #f4cf57 100%);
    color: #1a2f0a;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
    display: inline-block;
    border: 2px solid #2d5016;
}

/* Kategori Colors */
.org-box.pembantu {
    border-color: #4a7c2c;
    background: #f8f9fa;
}

.org-box.pelayanan {
    border-color: #5a9c3c;
    background: #f8f9fa;
}

.org-box.pelaksana {
    border-color: #6aac4c;
    background: #ffffff;
}

/* Tabs */
.org-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.org-tab {
    padding: 12px 30px;
    background: white;
    border: 2px solid #2d5016;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.org-tab:hover {
    background: #f8f9fa;
}

.org-tab.active {
    background: #2d5016;
    color: white;
}

.org-content {
    display: none;
}

.org-content.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .org-chart {
        gap: 15px;
    }
    
    .org-row {
        gap: 15px;
    }
    
    .org-box {
        min-width: 150px;
        max-width: 150px;
        min-height: 180px;
        padding: 12px;
    }
    
    .org-box-photo {
        width: 64px;
        height: 96px;
        margin-bottom: 10px;
    }
    
    .org-box-title {
        font-size: 0.7rem;
    }
    
    .org-box-name {
        font-size: 0.65rem;
    }
    
    .level-label {
        font-size: 0.7rem;
        padding: 6px 15px;
    }
    
    .org-connector {
        height: 25px;
    }
    
    .org-tab {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .org-chart-container {
        padding: 15px 8px;
    }
    
    .org-chart {
        gap: 12px;
    }
    
    .org-row {
        gap: 12px;
    }
    
    .org-box {
        min-width: 130px;
        max-width: 130px;
        min-height: 160px;
        padding: 10px;
    }
    
    .org-box-photo {
        width: 52px;
        height: 78px;
        margin-bottom: 8px;
        border-width: 2px;
    }
    
    .org-box-title {
        font-size: 0.65rem;
    }
    
    .org-box-name {
        font-size: 0.6rem;
    }
    
    .level-label {
        font-size: 0.65rem;
        padding: 5px 12px;
    }
    
    .org-connector {
        height: 20px;
        width: 2px;
    }
    
    .org-tabs {
        flex-direction: column;
        gap: 6px;
    }
    
    .org-tab {
        width: 100%;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Print Styles */
@media print {
    .org-tabs {
        display: none;
    }
    
    .org-content {
        display: block !important;
    }
    
    .org-box {
        break-inside: avoid;
    }
}
