/**
 * Стили для генеалогического древа
 */

/* Базовые переменные (если не загружены из style.css) */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --accent-primary: #4ECDC4;
    --accent-secondary: #FF6B6B;
    --accent-tertiary: #45B7D1;
    --border-color: #333333;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.family-tree-section {
    padding: 60px 0;
    padding-bottom: 160px; /* Отступ для навигации */
    min-height: calc(100vh - 200px);
}

.tree-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-tertiary);
    padding: 8px 15px;
    border-radius: 8px;
}

.zoom-controls button {
    background: var(--accent-primary);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.zoom-controls button:hover {
    background: var(--accent-secondary);
    transform: scale(1.1);
}

#zoomLevel {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

.tree-container {
    position: relative;
    width: 100%;
    min-height: 600px;
    background: var(--bg-secondary);
    border-radius: 15px;
    overflow: auto;
    border: 1px solid var(--border-color);
}

.tree-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.tree-nodes {
    position: relative;
    min-height: 600px;
    padding: 50px;
    z-index: 2;
}

.tree-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    min-width: 120px;
}

.tree-node:hover {
    transform: scale(1.1);
    z-index: 20;
}

.node-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
    transition: var(--transition);
}

.tree-node:hover .node-photo {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
}

.tree-node.male .node-photo {
    border-color: #4ECDC4;
}

.tree-node.female .node-photo {
    border-color: #FF6B6B;
}

.tree-node.main-person .node-photo {
    border-width: 4px;
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.7);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(78, 205, 196, 0.7);
    }
    50% {
        box-shadow: 0 0 40px rgba(78, 205, 196, 1);
    }
}

.node-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder-icon {
    font-size: 3rem;
    opacity: 0.7;
}

.node-info {
    text-align: center;
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 120px;
    border: 1px solid var(--border-color);
}

.node-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.tree-node.main-person .node-name {
    color: var(--accent-primary);
    font-weight: 700;
}

.node-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Связи между узлами */
.tree-connection {
    stroke: var(--border-color);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.tree-connection.parent {
    stroke: var(--accent-primary);
    stroke-width: 3;
}

.tree-connection.spouse {
    stroke: var(--accent-secondary);
    stroke-width: 2;
    stroke-dasharray: 5,5;
}

/* Адаптивность */
@media (max-width: 768px) {
    .tree-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .zoom-controls {
        justify-content: center;
    }
    
    .tree-nodes {
        padding: 30px 20px;
    }
    
    .tree-node {
        min-width: 100px;
    }
    
    .node-photo {
        width: 80px;
        height: 80px;
    }
    
    .node-info {
        min-width: 100px;
        padding: 6px 10px;
    }
    
    .node-name {
        font-size: 0.85rem;
    }
    
    .node-date {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .tree-nodes {
        padding: 20px 10px;
    }
    
    .tree-node {
        min-width: 80px;
    }
    
    .node-photo {
        width: 60px;
        height: 60px;
    }
    
    .photo-placeholder-icon {
        font-size: 2rem;
    }
    
    .node-info {
        min-width: 80px;
        padding: 5px 8px;
    }
    
    .node-name {
        font-size: 0.8rem;
    }
}

@media (min-width: 2000px) {
    .tree-nodes {
        padding: 80px;
    }
    
    .node-photo {
        width: 120px;
        height: 120px;
    }
    
    .node-info {
        min-width: 150px;
        padding: 12px 16px;
    }
    
    .node-name {
        font-size: 1.1rem;
    }
}

@media (min-width: 5000px) {
    .tree-nodes {
        padding: 120px;
    }
    
    .node-photo {
        width: 150px;
        height: 150px;
    }
    
    .node-info {
        min-width: 180px;
        padding: 15px 20px;
    }
    
    .node-name {
        font-size: 1.3rem;
    }
}

