﻿/* Organizational Chart Styles */

.org-chart-container {
    display: flex;
    position: relative;
    min-height: 80vh;
    padding: 20px;
}

    /*.org-chart-container {
    overflow: auto;
    width: 100%;
    height: 100%;
    position: relative;
}*/

    .org-chart-container h2 {
        text-align: center;
        color: #2c3e50;
        margin-bottom: 30px;
        font-weight: 600;
        font-size: 2rem;
    }

/*.org-chart {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    padding: 20px 0;
}*/

.org-chart {
    transform-origin: 0 0;
    transition: transform 0.1s ease-out;
    display: flex;
    width: fit-content;
    margin: 0 auto;
}

.org-level {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-node-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 20px;
    position: relative;
}

.org-node {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 16px;
    margin: 10px 0;
    min-width: 320px;
    max-width: 400px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

    .org-node:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
        border-color: #3498db;
    }

    .org-node.has-children {
        border-left: 4px solid #3498db;
    }

.node-image {
    flex-shrink: 0;
    margin-right: 16px;
}

    .node-image img {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid #ecf0f1;
        transition: border-color 0.3s ease;
    }

.org-node:hover .node-image img {
    border-color: #3498db;
}

.node-content {
    flex: 1;
    min-width: 0;
}

.node-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.node-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
}

.expand-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

    .expand-btn:hover {
        background: #2980b9;
        transform: scale(1.1);
    }

    .expand-btn.expanded {
        background: #e74c3c;
    }

        .expand-btn.expanded:hover {
            background: #c0392b;
        }

.node-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #3498db;
    margin-bottom: 4px;
    line-height: 1.3;
}

.node-description {
    font-size: 0.85rem;
    color: #7f8c8d;
    line-height: 1.4;
}

/* Connector Lines */
.children-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.connector-vertical {
    width: 2px;
    height: 30px;
    background: #bdc3c7;
    margin-top: 5px;
    border-radius: 1px;
}

.children-list {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    position: relative;
    margin-top: 0;
}

.child-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.connector-horizontal {
    transform: rotate(90deg);
    margin-top: 15px;
    margin-bottom: 5px;
    width: 30px;
    height: 2px;
    background: #bdc3c7;
    margin-bottom: 5px;
    border-radius: 1px;
    position: relative;
}

/* Horizontal connector line that spans across all children */
.children-list::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #bdc3c7;
    border-radius: 1px;
    z-index: 1;
}

.child-wrapper.only::before {
    display: none;
}

/*.children-list:has(.child-wrapper.only)::before {
    display: none;
}*/

/* Vertical connectors for children */
.child-wrapper::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 3px;
    background: #bdc3c7;
    border-radius: 1px;
    z-index: 2;
}

.child-wrapper.only::after {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .org-chart-container {
        padding: 10px;
    }

        .org-chart-container h2 {
            font-size: 1.5rem;
            margin-bottom: 20px;
        }

    .org-node {
        min-width: 280px;
        max-width: 320px;
        padding: 12px;
        margin: 8px 0;
        flex-direction: column;
        text-align: center;
    }

    .node-image {
        margin-right: 0;
        margin-bottom: 12px;
    }

        .node-image img {
            width: 50px;
            height: 50px;
        }

    .children-list {
        flex-direction: column;
        align-items: center;
    }

        .children-list::before {
            display: none;
        }

    .child-wrapper::after {
        display: none;
    }

    .connector-horizontal {
        transform: rotate(90deg);
        width: 30px;
        margin: 10px 0;
    }

    .org-node-container {
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    .org-node {
        min-width: 250px;
        max-width: 280px;
        padding: 10px;
    }

    .node-name {
        font-size: 1rem;
    }

    .node-title {
        font-size: 0.9rem;
    }

    .node-description {
        font-size: 0.8rem;
    }

    .connector-vertical {
        height: 20px;
    }
}

/* Animation for expand/collapse */
.children-container {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects for better interactivity */
.org-node-container:hover .connector-vertical,
.org-node-container:hover .connector-horizontal {
    background: #3498db;
}

.org-node-container:hover .children-list::before {
    background: #3498db;
}

.org-node-container:hover .child-wrapper::after {
    background: #3498db;
}


/* Manager Button Styling */
.manager-button-container {
    margin-top: 4px;
}

.manager-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    outline: none;
    border: none !important;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 0.5px;
}
.manager-btn {
    outline: none;
    border: none !important;
}
.manager-btn:focus {
    outline: none;
    border: none !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);

}
