/* ========================================
   ORGANIZATIONAL CHART STYLING
   ======================================== */

.org-chart-container {
    padding: 15px;
    overflow-x: auto;
    min-height: 500px;
}

/* LEVEL 1: TOP LEADER */
.org-level-1 {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

/* CONNECTOR LINES */
.org-connector-vertical {
    width: 3px;
    height: 35px;
    background: linear-gradient(to bottom, #cbd5e1, #94a3b8);
    margin: 0 auto;
    border-radius: 2px;
}

.org-connector-horizontal {
    width: 70%;
    height: 3px;
    background: linear-gradient(to right, #94a3b8, #cbd5e1, #94a3b8);
    margin: 0 auto 25px;
    border-radius: 2px;
    position: relative;
}

.org-connector-horizontal::before,
.org-connector-horizontal::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 25px;
    background: #94a3b8;
    top: 0;
}

.org-connector-horizontal::before {
    left: 16.66%;
}

.org-connector-horizontal::after {
    right: 16.66%;
}

/* LEVEL 2: THREE UNITS */
.org-level-2 {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    flex-wrap: wrap;
}

.org-unit {
    flex: 1;
    min-width: 260px;
    max-width: 340px;
}

/* SUB CONNECTORS */
.org-sub-connector {
    width: 3px;
    height: 20px;
    background: #cbd5e1;
    margin: 0 auto;
    border-radius: 2px;
}

.org-sub-level {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 2px dashed #e2e8f0;
}

/* CARD STYLES */
.org-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.org-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* TOP CARD (KETUA PENOLONG PENGARAH) */
.org-card-top {
    border: 3px solid #1e3a8a;
    max-width: 300px;
}

.org-card-top .org-card-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    padding: 18px;
    text-align: center;
}

/* HEAD CARDS (KETUA UNIT) */
.org-card-head {
    border: 2px solid #e2e8f0;
}

.org-card-head .org-card-header {
    padding: 14px;
    text-align: center;
}

/* STAFF CARDS (PENOLONG PENGARAH) */
.org-card-staff {
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.org-card-staff:hover {
    border-color: #94a3b8;
    transform: translateX(3px);
}

/* AVATAR */
.org-avatar {
    width: 65px;
    height: 65px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.9rem;
    color: #1e3a8a;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.org-card-head .org-avatar {
    width: 55px;
    height: 55px;
    font-size: 1.6rem;
}

/* CARD BODY */
.org-card-body {
    padding: 18px;
    text-align: center;
}

.org-card-body-compact {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* TEXT STYLES */
.org-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.25;
    text-transform: uppercase;
}

.org-position {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0;
}

.org-name-small {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
}

.org-position-small {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
}

/* COLOR VARIATIONS */
.org-card-header.bg-primary { 
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important; 
    color: white; 
}

.org-card-header.bg-success { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; 
    color: white; 
}

.org-card-header.bg-warning { 
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; 
    color: white; 
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .org-level-2 {
        flex-direction: column;
        align-items: center;
    }
    
    .org-connector-horizontal {
        display: none;
    }

    .org-unit {
        max-width: 100%;
    }

    .org-chart-container {
        padding: 10px;
        min-height: 400px;
    }

    .org-avatar {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }

    .org-card-head .org-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .org-name {
        font-size: 0.85rem;
    }

    .org-position {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .org-card-body {
        padding: 12px;
    }

    .org-name {
        font-size: 0.8rem;
    }

    .org-name-small {
        font-size: 0.75rem;
    }

    .org-position-small {
        font-size: 0.6rem;
    }

    .org-chart-container {
        padding: 8px;
    }
}