/* Organizational Structure Stylesheet for Koperasi Merah Putih Serua */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --red-primary: #D32F2F;
    --white: #FFFFFF;
    --black: #212529;
    --grey-background: #F8F9FA;
    --grey-light: #E9ECEF;
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-heavy: 0 6px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 6px;
    --transition: all 0.3s ease-in-out;
    --font-primary: 'Poppins', sans-serif;
}

.section-organization {
    padding: 2.5rem 0;
    background: var(--grey-background);
    font-family: var(--font-primary);
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--red-primary);
    margin-bottom: 0.8rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background: var(--red-primary);
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.section-subtitle {
    text-align: center;
    max-width: 500px;
    margin: 0 auto 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.org-tree {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 1.5rem 0;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.org-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--red-primary);
    margin-bottom: 1rem;
    position: relative;
}

.org-section h3::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background: var(--red-primary);
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.org-levels {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-level {
    width: 100%;
    position: relative;
    margin-bottom: 1rem;
}

.org-nodes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    position: relative;
}

.org-node {
    flex: 0 0 auto;
    position: relative;
    min-width: 200px;
    max-width: 220px;
}

.org-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--white);
    padding: 0.8rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    text-align: center;
}

.org-member.org-head {
    background: var(--red-primary);
    box-shadow: var(--shadow-heavy);
}

.org-member:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.org-photo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 0.6rem;
    border: 1.5px solid var(--white);
}

.org-details p {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.org-details strong {
    font-weight: 600;
    color: var(--text-primary);
}

.org-member.org-head .org-details p,
.org-member.org-head .org-details strong {
    color: var(--white) !important;
}

.org-connector {
    height: 25px;
    width: 100%;
    position: relative;
}

.org-connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1.5px;
    height: 25px;
    background: var(--red-primary);
    transform: translateX(-50%);
}

.org-level:not(.level-1) .org-nodes::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: var(--red-primary);
}

.org-level:not(.level-1) .org-node::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 50%;
    width: 1.5px;
    height: 25px;
    background: var(--red-primary);
    transform: translateX(-50%);
}

.last-updated {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .org-node {
        min-width: 180px;
        max-width: 200px;
    }
    .org-nodes {
        gap: 0.6rem;
    }
}

@media (max-width: 768px) {
    .org-tree {
        gap: 1.5rem;
    }
    .org-section h3 {
        font-size: 1.3rem;
    }
    .org-nodes {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }
    .org-node {
        min-width: 160px;
        max-width: 180px;
    }
    .org-member {
        padding: 0.7rem;
    }
    .org-photo {
        width: 44px;
        height: 44px;
    }
    .org-details p {
        font-size: 0.75rem;
    }
    .org-connector::before {
        height: 20px;
        top: -20px;
    }
    .org-level:not(.level-1) .org-nodes::before {
        top: -20px;
        height: 1.5px;
    }
    .org-level:not(.level-1) .org-node::before {
        top: -20px;
        height: 20px;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.5rem;
    }
    .section-subtitle {
        font-size: 0.85rem;
    }
    .org-section h3 {
        font-size: 1.2rem;
    }
    .org-node {
        min-width: 140px;
        max-width: 160px;
    }
    .org-member {
        padding: 0.6rem;
    }
    .org-photo {
        width: 40px;
        height: 40px;
    }
    .org-details p {
        font-size: 0.7rem;
    }
    .org-connector::before {
        height: 15px;
        top: -15px;
    }
    .org-level:not(.level-1) .org-nodes::before {
        top: -15px;
        height: 1.5px;
    }
    .org-level:not(.level-1) .org-node::before {
        top: -15px;
        height: 15px;
    }
}