/* Organization Chart Styles */
:root {
    --org-accent: #134eb4;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-blur: blur(12px);
}

.org-canvas-wrapper {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background-color: #000;
}

.org-backdrop {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    transition: transform 0.1s ease-out;
    z-index: 1;
}

.org-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, rgba(0,0,0,0.8) 100%);
    z-index: 2;
}

.org-panzoom-container {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 3;
    cursor: grab;
}

.org-panzoom-container:active {
    cursor: grabbing;
}

/* Update Badge */
.org-update-badge {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.org-update-badge .label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.6;
    font-weight: 800;
    line-height: 1;
}

.org-update-badge .value {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.update-icon-pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 12px #10b981;
    animation: updatePulse 2s infinite;
}

@keyframes updatePulse {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.3); opacity: 0.8; box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
/* Rich Text Content Styling */
.rich-text-content p {
    margin-bottom: 1rem;
}
.rich-text-content p:last-child {
    margin-bottom: 0;
}
.rich-text-content ul, .rich-text-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.rich-text-content strong {
    font-weight: 700;
}
.rich-text-content em {
    font-style: italic;
}

.org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100px;
    transform-origin: center;
}

.org-nodes-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    position: relative;
}

/* Node Entrance Animation */
@keyframes node-entrance {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.org-node-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Glassmorphism Card */
.org-card {
    width: 260px;
    height: 380px; /* Standardized height */
    padding: 0;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Layer specific styling if needed */
.org-card.level-2 {
    height: 380px; /* Explicitly standardizing Layer 2 */
}

.org-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--org-accent);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 20px rgba(19, 78, 180, 0.3);
}

.org-avatar-container {
    padding: 12px;
    position: relative;
    flex-shrink: 0;
}

.org-avatar {
    width: 100%;
    height: 250px; /* Adjusted to fit standardized card height */
    border-radius: 8px;
    margin: 0;
    border: 3px solid #fff;
    padding: 0;
    background: #1a1a1a;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
}

.org-card:hover .org-avatar {
    border-color: var(--org-accent);
}

.org-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    transition: transform 0.5s ease;
}

.org-card:hover .org-avatar img {
    transform: scale(1.1);
}

.org-info {
    padding: 10px 12px 15px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.4));
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.org-name {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.org-position {
    font-size: 0.75rem;
    color: #ffd700; /* Gold color for position to pop */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.org-dept-badge {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px 12px;
    background: var(--org-accent);
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Connecting Lines */
.org-line-v {
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, var(--glass-border), var(--org-accent), var(--glass-border));
    box-shadow: 0 0 10px rgba(19, 78, 180, 0.3);
}

.org-line-h-wrap {
    width: 100%;
    height: 2px;
    position: relative;
    background: linear-gradient(to right, transparent, var(--org-accent), transparent);
    margin-bottom: 60px;
    box-shadow: 0 0 10px rgba(19, 78, 180, 0.3);
}

/* Pulse Animation */
@keyframes pulse-ring {
    0% { transform: scale(0.33); opacity: 0; }
    80%, 100% { opacity: 0; }
}

@keyframes pulse-dot {
    0% { transform: scale(0.8); }
    50% { transform: scale(1); }
    100% { transform: scale(0.8); }
}

.pulse-active {
    box-shadow: 0 0 0 0 var(--org-accent);
    animation: pulse-ring-anim 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring-anim {
    0% { box-shadow: 0 0 0 0 rgba(19, 78, 180, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(19, 78, 180, 0); }
    100% { box-shadow: 0 0 0 0 rgba(19, 78, 180, 0); }
}

/* Search Bar */
.org-search-wrap {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 100;
    width: 350px;
}

.org-search-input {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    padding: 12px 20px 12px 45px;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.org-search-input:focus {
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--org-accent);
    outline: none;
    box-shadow: 0 0 20px rgba(19, 78, 180, 0.4), 0 8px 32px rgba(0,0,0,0.5);
    width: 400px;
}

.org-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
}

/* Mobile Handling */
@media (max-width: 768px) {
    .org-tree {
        display: none;
    }
}

.org-mobile-view {
    display: block;
}
