/* Organization Chart Styling - Final Robust Version */
.org-container {
    padding: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
    background-color: transparent;
}

.org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    min-width: 1000px;
    padding: 40px;
}

.org-node {
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    text-align: center;
    min-width: 190px;
    background: #fff;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 2;
}

.org-node:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.node-ceo {
    background-color: #ffc107;
    color: #333;
    font-weight: 700;
    font-size: 1.3rem;
    border: none;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.4);
}

.node-director {
    background-color: #444;
    color: #fff;
    border: none;
}

.node-admin {
    background-color: #f0f0f0;
    color: #333;
    min-width: 160px;
    font-size: 1.05rem;
}

/* Flex-based Admin Group to prevent clipping */
.org-admin-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}

.admin-group {
    display: flex;
    align-items: center;
}

.admin-line {
    width: 50px;
    height: 2px;
    background-color: #bbb;
}

.admin-spacer {
    width: 210px;
    /* node-admin(160) + admin-line(50) = 210 */
}

.node-main {
    background-color: #f5f5f5;
    color: #333;
    font-weight: 700;
    border: 1px solid #ddd;
}

.node-sub {
    background-color: #fff;
    border: 1px solid #eee;
    color: #666;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Main Vertical Connectors */
.org-tree>.org-node::after,
.org-admin-wrapper::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 50%;
    width: 2px;
    height: 50px;
    background-color: #bbb;
    z-index: 1;
}

.org-tree>.org-node:last-child::after {
    display: none;
}

.org-branches {
    display: flex;
    width: 100%;
    position: relative;
    padding-top: 50px;
}

/* Horizontal Connector for Branches */
.org-branches::before {
    content: '';
    position: absolute;
    top: 0;
    left: 16.666%;
    right: 16.666%;
    height: 2px;
    background-color: #bbb;
    z-index: 1;
}

.org-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
}

.org-column .org-node {
    margin: 5px 0;
}

/* Vertical lines from horizontal bar down to each column header */
.org-column::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    width: 2px;
    height: 50px;
    background-color: #bbb;
    z-index: 1;
}

/* Mobile Responsiveness */
@media (max-width: 1000px) {
    .org-container {
        padding: 20px 10px;
    }

    .org-tree {
        min-width: auto;
        padding: 20px;
        gap: 30px;
    }

    .org-admin-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .admin-group {
        flex-direction: column;
    }

    .admin-line {
        width: 2px;
        height: 20px;
    }

    .admin-spacer {
        display: none;
    }

    .org-branches {
        flex-direction: column;
        gap: 40px;
    }

    .org-branches::before,
    .org-column::before {
        display: none;
    }
}