/* Org Chart Styles */
.org-chart-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 500px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.org-chart-svg {
    cursor: grab;
}

.org-chart-svg:active {
    cursor: grabbing;
}

/* Nodes */
.org-chart-svg .node {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.org-chart-svg .node:hover .node-rect {
    stroke: #4f46e5;
    stroke-width: 2px;
}

.org-chart-svg .node.dragging {
    opacity: 0.7;
}

.org-chart-svg .node-rect {
    fill: #ffffff;
    stroke: #cbd5e1;
    stroke-width: 1.5px;
    transition: all 0.2s ease;
}

.org-chart-svg .node-rect.has-children {
    fill: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.org-chart-svg .node-rect.is-collapsed {
    stroke: #94a3b8;
    stroke-dasharray: 4, 2;
}

.org-chart-svg .node-rect.drop-target {
    fill: #dbeafe;
    stroke: #3b82f6;
    stroke-width: 3px;
}

.org-chart-svg .node-title {
    font-size: 14px;
    font-weight: 600;
    fill: #1e293b;
    pointer-events: none;
}

.org-chart-svg .node-description {
    font-size: 11px;
    fill: #64748b;
    pointer-events: none;
}

.org-chart-svg .node-toggle {
    fill: #e2e8f0;
    stroke: #94a3b8;
    stroke-width: 1.5px;
    cursor: pointer;
    transition: fill 0.2s ease;
}

.org-chart-svg .node-toggle:hover {
    fill: #cbd5e1;
}

.org-chart-svg .node-toggle-text {
    font-size: 14px;
    font-weight: bold;
    fill: #475569;
    pointer-events: none;
}

/* Links */
.org-chart-svg .link {
    fill: none;
    stroke: #94a3b8;
    stroke-width: 1.5px;
    stroke-opacity: 0.6;
}

/* Controls */
.org-chart-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.org-chart-controls .btn-group-vertical {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.org-chart-controls .btn {
    border: none;
    background: white;
    padding: 10px 14px;
    font-size: 16px;
    color: #475569;
    transition: all 0.15s ease;
}

.org-chart-controls .btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.org-chart-controls .btn:active {
    background: #e2e8f0;
}

/* Breadcrumb navigation */
.org-chart-breadcrumb {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.org-chart-breadcrumb .breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
}

.org-chart-breadcrumb .breadcrumb-item {
    font-size: 14px;
}

.org-chart-breadcrumb .breadcrumb-item a {
    color: #4f46e5;
    text-decoration: none;
    transition: color 0.15s ease;
}

.org-chart-breadcrumb .breadcrumb-item a:hover {
    color: #4338ca;
    text-decoration: underline;
}

.org-chart-breadcrumb .breadcrumb-item.active {
    color: #1e293b;
    font-weight: 600;
}

/* Depth selector */
.org-chart-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.org-chart-toolbar .depth-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.org-chart-toolbar .depth-control label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    margin: 0;
}

.org-chart-toolbar .depth-control select {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #1e293b;
    cursor: pointer;
}

.org-chart-toolbar .depth-control select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.org-chart-toolbar .btn-link {
    font-size: 14px;
    color: #4f46e5;
    text-decoration: none;
    padding: 6px 12px;
}

.org-chart-toolbar .btn-link:hover {
    text-decoration: underline;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 6px;
}

/* Info panel */
.org-chart-info {
    position: absolute;
    bottom: 16px;
    left: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    color: #64748b;
    max-width: 300px;
    z-index: 10;
}

.org-chart-info .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.org-chart-info .close-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.org-chart-info strong {
    color: #1e293b;
}

.org-chart-info ul {
    margin: 8px 0 0;
    padding-left: 16px;
}

.org-chart-info li {
    margin: 4px 0;
}

/* Loading state */
.org-chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #64748b;
    font-size: 16px;
}

.org-chart-loading .spinner-border {
    margin-right: 12px;
}

/* Error state */
.org-chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #dc2626;
    text-align: center;
    padding: 24px;
}

.org-chart-error i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.org-chart-error h4 {
    margin: 0 0 8px;
    font-size: 18px;
}

.org-chart-error p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}
