/* =====================================
   Organizational Chart - Hierarchical Design
   الهيكل التنظيمي - تصميم هرمي إبداعي
   ===================================== */

/* Background Gradient */
.org-chart-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    direction: rtl;
}

/* Main Container */
.org-chart {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
    position: relative;
}

/* Organization Levels */
.org-level {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
}

/* Level 1 - CEO/Director */
.level-1 {
    justify-content: center;
}

/* Level 2 - Managers */
.level-2 {
    justify-content: center;
    flex-wrap: wrap;
}

/* Level 3 - Staff */
.level-3 {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* Organization Cards */
.org-card {
    position: relative;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: visible;
}

.org-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 60px rgba(207, 134, 75, 0.25);
    z-index: 10;
}

/* CEO Card - أكبر وأبرز */
.ceo-card {
    width: 280px;
}

.ceo-card .card-inner {
    padding: 2rem 1.5rem;
}

/* Manager Card - متوسط */
.manager-card {
    width: 240px;
}

.manager-card .card-inner {
    padding: 1.5rem 1rem;
}

/* Staff Card - صغير */
.staff-card {
    width: 200px;
}

.staff-card .card-inner {
    padding: 1rem 0.75rem;
}

/* Card Inner */
.card-inner {
    text-align: center;
}

/* Organization Image */
.org-image {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.ceo-card .org-image img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid #cf864b;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(207, 134, 75, 0.3);
}

.manager-card .org-image img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #6c757d;
    object-fit: cover;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.staff-card .org-image img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #dee2e6;
    object-fit: cover;
}

/* Badge on Image */
.org-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #cf864b, #b8733a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(207, 134, 75, 0.4);
    border: 3px solid white;
}

.manager-card .org-badge {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #6c757d, #495057);
}

/* Organization Info */
.org-info {
    text-align: center;
}

.org-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.ceo-card .org-name {
    font-size: 1.3rem;
    color: #cf864b;
}

.org-position {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

/* Contact Icons */
.org-contact {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.contact-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cf864b;
    transition: all 0.3s ease;
    text-decoration: none;
}

.contact-icon:hover {
    background: #cf864b;
    color: white;
    transform: scale(1.15);
}

/* Connectors - الخطوط الواصلة */
.org-connector {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, #cf864b, #dee2e6);
}

.org-connector-main {
    height: 2px;
    background: linear-gradient(to right, transparent 10%, #dee2e6 50%, transparent 90%);
    margin: 0 auto 3rem;
    max-width: 800px;
    position: relative;
}

.org-connector-main::before,
.org-connector-main::after {
    content: '';
    position: absolute;
    top: 0;
    width: 2px;
    height: 30px;
    background: #dee2e6;
}

.org-connector-main::before {
    left: 20%;
}

.org-connector-main::after {
    right: 20%;
}

.org-connector-vertical {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, #dee2e6, transparent);
}

/* Decorative Elements */
.org-chart-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(207, 134, 75, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(53, 53, 53, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 992px) {
    .org-level {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .ceo-card,
    .manager-card,
    .staff-card {
        width: 100%;
        max-width: 320px;
    }
    
    .org-connector,
    .org-connector-vertical {
        display: none;
    }
    
    .org-connector-main {
        display: none;
    }
    
    .level-2,
    .level-3 {
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .ceo-card .card-inner {
        padding: 1.5rem 1rem;
    }
    
    .ceo-card .org-image img {
        width: 100px;
        height: 100px;
    }
    
    .manager-card .org-image img {
        width: 90px;
        height: 90px;
    }
    
    .staff-card .org-image img {
        width: 75px;
        height: 75px;
    }
    
    .org-badge {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
}

/* Hover Animation for Cards */
.org-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(207, 134, 75, 0.1), rgba(53, 53, 53, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.org-card:hover::before {
    opacity: 1;
}

/* Section Header Enhancement */
.org-chart-section .section-header h6 {
    position: relative;
    display: inline-block;
}

.org-chart-section .section-header h6::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #cf864b, #b8733a);
    border-radius: 2px;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.org-card {
    animation: fadeInUp 0.6s ease-out;
}

.level-1 .org-card {
    animation-delay: 0.1s;
}

.level-2 .org-card:nth-child(1) {
    animation-delay: 0.3s;
}

.level-2 .org-card:nth-child(2) {
    animation-delay: 0.4s;
}

.level-2 .org-card:nth-child(3) {
    animation-delay: 0.5s;
}

.level-3 .org-card {
    animation-delay: 0.6s;
}

