/*--------------------------------------------------------------
# Organizational Chart - Modern Design
# Organigramme interactif avec design moderne
--------------------------------------------------------------*/

/* Section Container */
.org-chart-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

/* Section Header */
.org-chart-header {
    text-align: center;
    margin-bottom: 70px;
}

.org-chart-header h2 {
    font-size: 42px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.org-chart-header p {
    font-size: 18px;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* Org Chart Container */
.org-chart {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

/* Box Styles */
.org-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 25px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

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

.org-box h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: #1a1a1a;
}

/* Color Variants */
.org-box.green {
    border: 3px solid #009B3A;
}

.org-box.orange {
    border: 3px solid #FF8200;
}

.org-box.blue {
    border: 3px solid #0066CC;
}

.org-box.gray {
    border: 3px solid #6c757d;
}

/* Level 1 - President */
.level-1 {
    display: flex;
    justify-content: center;
    margin-bottom: 80px;
    position: relative;
}

.level-1 .org-box {
    width: 350px;
    padding: 25px;
}

/* Vertical Line from President to Level 2 */
.level-1::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 40px;
    background: #009B3A;
}

/* Level 2 - Vice President */
.level-2 {
    display: flex;
    justify-content: center;
    gap: 200px;
    margin-bottom: 80px;
    position: relative;
}

.level-2 .org-box {
    width: 280px;
    position: relative;
}

/* Horizontal line at top of Level 2 connecting both boxes */
.level-2::before {
    content: '';
    position: absolute;
    top: -40px;
    left: calc(50% - 150px);
    width: 300px;
    height: 3px;
    background: linear-gradient(90deg, #009B3A, #FF8200);
}

/* T-junction at center top */
.level-2::after {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    background: #009B3A;
    box-shadow: 0 0 0 4px #009B3A;
    border-radius: 50%;
}

/* Vertical lines from each Level 2 box down */
.level-2 .org-box:nth-child(1)::before,
.level-2 .org-box:nth-child(2)::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 40px;
    background: inherit;
    border-color: inherit;
}

.level-2 .org-box:nth-child(1)::before {
    background: #009B3A;
}

.level-2 .org-box:nth-child(2)::before {
    background: #FF8200;
}

/* Vertical lines going down from Level 2 */
.level-2 .org-box::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 40px;
}

.level-2 .org-box:nth-child(1)::after {
    background: #009B3A;
}

.level-2 .org-box:nth-child(2)::after {
    background: #FF8200;
}

/* Level 3 - Main Branches */
.level-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 80px;
    position: relative;
}

/* Horizontal line connecting all Level 3 boxes */
.level-3::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #009B3A 0%, #009B3A 33%, #6c757d 33%, #6c757d 66%, #0066CC 66%, #0066CC 100%);
}

.level-3 .org-box {
    min-height: 100px;
    position: relative;
}

/* Vertical line down from each Level 3 box */
.level-3 .org-box::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 40px;
}

.level-3 .org-box:nth-child(1)::before {
    background: #009B3A;
}

.level-3 .org-box:nth-child(2)::before {
    background: #6c757d;
}

.level-3 .org-box:nth-child(3)::before {
    background: #0066CC;
}

/* Vertical lines going down to Level 4 */
.level-3 .org-box::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 40px;
}

.level-3 .org-box:nth-child(1)::after {
    background: #009B3A;
}

.level-3 .org-box:nth-child(2)::after {
    background: #FF8200;
}

.level-3 .org-box:nth-child(3)::after {
    background: #0066CC;
}

/* Level 4 - Detailed Positions */
.level-4 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 50px;
    position: relative;
}

.level-4 .org-box {
    min-height: 90px;
    font-size: 13px;
    position: relative;
}

.level-4 .org-box h4 {
    font-size: 12px;
}

/* Horizontal connector line for Level 4 groups */
.level-4:first-of-type::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 10%;
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, 
        #009B3A 0%, #009B3A 15%,
        transparent 15%, transparent 20%,
        #009B3A 20%, #009B3A 35%,
        transparent 35%, transparent 40%,
        #009B3A 40%, #009B3A 55%,
        transparent 55%, transparent 60%,
        #FF8200 60%, #FF8200 75%,
        transparent 75%, transparent 80%,
        #0066CC 80%, #0066CC 100%
    );
}

/* Vertical connectors from horizontal line to boxes */
.level-4:first-of-type .org-box::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 40px;
}

.level-4:first-of-type .org-box:nth-child(1)::before,
.level-4:first-of-type .org-box:nth-child(2)::before,
.level-4:first-of-type .org-box:nth-child(3)::before {
    background: #009B3A;
}

.level-4:first-of-type .org-box:nth-child(4)::before {
    background: #FF8200;
}

.level-4:first-of-type .org-box:nth-child(5)::before {
    background: #0066CC;
}

/* Badge for positions */
.position-badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    margin-top: 5px;
    font-weight: 600;
}

.position-badge.green {
    background: rgba(0, 155, 58, 0.1);
    color: #009B3A;
}

.position-badge.orange {
    background: rgba(255, 130, 0, 0.1);
    color: #FF8200;
}

.position-badge.blue {
    background: rgba(0, 102, 204, 0.1);
    color: #0066CC;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .level-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .org-chart-section {
        padding: 70px 0;
    }
    
    .level-2 {
        flex-direction: column;
        align-items: center;
    }
    
    .level-2::after {
        display: none;
    }
    
    .level-3 {
        grid-template-columns: 1fr;
    }
    
    .level-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .org-chart-section {
        padding: 60px 0;
    }
    
    .org-chart-header h2 {
        font-size: 32px;
    }
    
    .level-1 .org-box,
    .level-2 .org-box {
        width: 100%;
        max-width: 320px;
    }
    
    .level-4 {
        grid-template-columns: 1fr;
    }
    
    .org-box {
        padding: 15px 20px;
    }
    
    .org-box h4 {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .org-chart-header h2 {
        font-size: 28px;
    }
    
    .org-chart-header p {
        font-size: 16px;
    }
}
