:root {
    /* Color Palette - Modern Tech Theme */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    --bg-dark: #0a0e27;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.4);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #667eea 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #f5576c 0%, transparent 70%);
    top: 50%;
    right: -10%;
    animation-delay: 7s;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #4facfe 0%, transparent 70%);
    bottom: -10%;
    left: 30%;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    animation: fadeInDown 0.8s ease;
}

.main-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 400;
}

/* Org Chart */
.org-chart {
    position: relative;
    padding: var(--spacing-xl) 0;
}

.level {
    position: relative;
    margin-bottom: var(--spacing-xl);
    animation: fadeIn 0.8s ease;
}

/* Node Styles */
.node {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: var(--spacing-md);
    padding-top: calc(var(--spacing-md) + 8px);
    position: relative;
    cursor: pointer;
    transition: all var(--transition-medium);
    overflow: visible;
    animation: slideUp 0.6s ease backwards;
}

.node::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-medium);
    z-index: 0;
}

.node:hover::before {
    opacity: 0.1;
}

.node:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: rgba(102, 126, 234, 0.5);
}

.node-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;
    animation: bounce 2s infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.node-icon img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(102, 126, 234, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-medium);
    display: block;
}

.node:hover .node-icon img {
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

.node-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.node-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.node-title {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.node-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-medium);
    pointer-events: none;
}

.node:hover .node-glow {
    opacity: 1;
}

/* All Nodes - Same Size */
.director-node,
.manager-node,
.team-lead-node,
.developer-node,
.general-director-node {
    width: 300px;
    max-width: 300px;
    min-height: 200px;
    margin: 0 auto;
    position: relative;
    overflow: visible;
}

/* General Director Node - Purple theme (Compact bubble) */
.general-director-node.compact {
    width: 250px;
    max-width: 250px;
    min-height: 150px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    border: 2px solid rgba(168, 85, 247, 0.6);
    border-left: 4px solid #a855f7;
    border-radius: 20px;
}

.general-director-node.compact .node-icon img {
    width: 70px;
    height: 70px;
    border: 3px solid rgba(168, 85, 247, 0.6);
}

.general-director-node.compact .node-name {
    font-size: 1.1rem;
}

.general-director-node.compact .node-title {
    font-size: 0.9rem;
}

.general-director-node.compact:hover .node-icon img {
    border-color: #a855f7;
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.6);
}

.general-director-node.compact:hover {
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.5);
}


/* Director Node */
.director-node {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
}

/* Desarrollo Department - Purple/Blue theme */
.developer-node {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-left: 4px solid #8b5cf6;
}

/* Team Leads - Green theme (Franklin, Rubén, Isaac) */
#franklin,
.team-lead-node {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
    border: 2px solid rgba(52, 211, 153, 0.4);
    border-left: 4px solid #34d399;
}

/* Sistemas Department - Orange/Yellow theme */
#josejuan,
#oscar {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
    border: 2px solid rgba(251, 146, 60, 0.4);
    border-left: 4px solid #fb923c;
}

.director-node .node-name,
.manager-node .node-name,
.team-lead-node .node-name,
.developer-node .node-name {
    font-size: 1.25rem;
}

.director-node .node-title,
.manager-node .node-title,
.team-lead-node .node-title,
.developer-node .node-title {
    font-size: 0.95rem;
}

.director-node .node-icon img,
.manager-node .node-icon img,
.team-lead-node .node-icon img,
.developer-node .node-icon img {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(102, 126, 234, 0.4);
}

/* Desarrollo - Purple borders on images */
.developer-node .node-icon img {
    border: 3px solid rgba(139, 92, 246, 0.5);
}

.developer-node:hover .node-icon img {
    border-color: #8b5cf6;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

/* Team Leads - Green borders on images (Franklin, Rubén, Isaac) */
#franklin .node-icon img,
.team-lead-node .node-icon img {
    border: 3px solid rgba(52, 211, 153, 0.5);
}

#franklin:hover .node-icon img,
.team-lead-node:hover .node-icon img {
    border-color: #34d399;
    box-shadow: 0 8px 25px rgba(52, 211, 153, 0.6);
}

/* Sistemas - Orange borders on images */
#josejuan .node-icon img,
#oscar .node-icon img {
    border: 3px solid rgba(251, 146, 60, 0.5);
}

#josejuan:hover .node-icon img,
#oscar:hover .node-icon img {
    border-color: #fb923c;
    box-shadow: 0 8px 25px rgba(251, 146, 60, 0.6);
}

.director-node:hover .node-icon img {
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* Department Badges */
.department-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 20px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    animation: badgePulse 3s ease-in-out infinite;
    white-space: nowrap;
}

.desarrollo-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    color: white;
    border: 2px solid rgba(139, 92, 246, 0.5);
}

.sistemas-badge {
    background: linear-gradient(135deg, #fb923c 0%, #f59e0b 100%);
    color: white;
    border: 2px solid rgba(251, 146, 60, 0.5);
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        transform: translateX(-50%) scale(1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
        transform: translateX(-50%) scale(1.05);
    }
}

/* Hover effects for departments */
.developer-node:hover {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

#franklin:hover,
.team-lead-node:hover {
    border-color: rgba(52, 211, 153, 0.6);
    box-shadow: 0 8px 30px rgba(52, 211, 153, 0.4);
}

#josejuan:hover,
#oscar:hover {
    border-color: rgba(251, 146, 60, 0.6);
    box-shadow: 0 8px 30px rgba(251, 146, 60, 0.4);
}

/* Main Container - Prescillia y Abdiel (columna) + Círculo (al lado) */
.level-main-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.main-container {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    align-items: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Columna de directores: Prescillia arriba de Abdiel */
.directors-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

/* Wrapper del círculo de departamentos */
.departments-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

/* Título HOLDING */
.holding-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin: 0;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Departments Circle - White Circle Container */
.departments-circle {
    width: 280px;
    height: 280px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    position: relative;
    flex-shrink: 0;
}

/* Department Tags - Inside Circle */
.department-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.3) 0%, rgba(71, 85, 105, 0.3) 100%);
    border: 2px solid rgba(100, 116, 139, 0.6);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-medium);
    min-width: 120px;
    text-align: center;
}

.department-tag span {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.department-tag:hover {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.5) 0%, rgba(71, 85, 105, 0.5) 100%);
    border-color: rgba(100, 116, 139, 0.8);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.4);
}

.level-2 .node-container {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
}

.level-2-main {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    align-items: flex-start;
    margin: 0 auto;
}

.sistemas-group {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

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

/* Franklin's Team Row */
.franklin-team {
    margin-top: var(--spacing-xl);
}

.team-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 300px));
    gap: var(--spacing-lg);
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
}

.team-member {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Subordinates Level */
.subordinates-team {
    margin-top: 0;
}

.subordinates-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 300px));
    gap: var(--spacing-lg);
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
}

.subordinate-member {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subordinate-member:first-child {
    grid-column: 1;
}

.subordinate-member:last-child {
    grid-column: 2;
}

/* Connection Lines - Hidden */
.connection-line {
    display: none;
}

.vertical-line {
    display: none;
}

.horizontal-line {
    display: none;
}

.line-1 {
    display: none;
}

.connection-hub {
    display: none;
}

.hub-1 {
    display: none;
}

.line-2,
.line-2a, 
.line-2b, 
.line-2c,
.hub-franklin,
.line-franklin,
.line-3a, 
.line-3b, 
.line-3c, 
.line-3d,
.line-4a, 
.line-4b {
    display: none;
}


/* Footer */
.footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}



/* Stagger Animation Delays */
.level-0 .node { animation-delay: 0s; }
.level-1 .node { animation-delay: 0.1s; }
.level-2 .node-wrapper:nth-child(1) .node { animation-delay: 0.2s; }
.level-2 .node-wrapper:nth-child(2) .node { animation-delay: 0.3s; }
.level-2 .node-wrapper:nth-child(3) .node { animation-delay: 0.4s; }
.team-member:nth-child(1) .node { animation-delay: 0.5s; }
.team-member:nth-child(2) .node { animation-delay: 0.6s; }
.team-member:nth-child(3) .node { animation-delay: 0.7s; }
.team-member:nth-child(4) .node { animation-delay: 0.8s; }
.subordinate-member:nth-child(1) .node { animation-delay: 0.9s; }
.subordinate-member:nth-child(2) .node { animation-delay: 1s; }

/* Responsive Design */
@media (max-width: 1024px) {
    .team-row {
        grid-template-columns: repeat(2, minmax(250px, 300px));
        gap: var(--spacing-md);
    }
    
    .subordinates-row {
        grid-template-columns: repeat(2, minmax(250px, 300px));
        gap: var(--spacing-md);
    }
    
}

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .main-container {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-lg);
    }
    
    .directors-column {
        gap: var(--spacing-md);
    }
    
    .departments-circle {
        width: 250px;
        height: 250px;
    }
    
    .department-tag {
        min-width: 100px;
        padding: 0.4rem 0.8rem;
    }
    
    .department-tag span {
        font-size: 0.8rem;
    }
    
    .general-director-node.compact {
        width: 280px;
    }
    
    .level-2 .node-container,
    .level-2-main {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-lg);
    }
    
    .sistemas-group {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .team-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        max-width: 350px;
    }
    
    .subordinates-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        max-width: 350px;
    }
    
    
    .node {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .node-icon {
        font-size: 2rem;
    }
    
    .node-icon img {
        width: 60px;
        height: 60px;
    }
    
    .director-node .node-icon img {
        width: 80px;
        height: 80px;
    }
    
    .manager-node .node-icon img {
        width: 70px;
        height: 70px;
    }
    
    .node-name {
        font-size: 1.1rem;
    }
    
    .node-title {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .departments-circle {
        width: 220px;
        height: 220px;
        gap: 0.5rem;
    }
    
    .department-tag {
        min-width: 90px;
        padding: 0.35rem 0.7rem;
    }
    
    .department-tag span {
        font-size: 0.75rem;
    }
    
    .director-node,
    .manager-node,
    .team-lead-node,
    .developer-node {
        max-width: 100%;
    }
}

/* Print Styles */
@media print {
    .background-animation {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .node {
        border: 2px solid #333;
        break-inside: avoid;
    }
}
