/* Styles pour la section Relations Divines */

.deity-relations {
    background: linear-gradient(135deg, #0c131b 0%, #1e2a3a 50%, #0c131b 100%);
    padding: var(--spacing-xl) 0;
    position: relative;
    overflow: hidden;
}

.deity-relations::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23c9a96e" fill-opacity="0.05"><polygon points="60,0 60,60 0,60 30,30"/></g></g></svg>');
    opacity: 0.1;
    z-index: 1;
}

.deity-relations .section-title {
    text-align: center;
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.deity-relations .section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold) 0%, transparent 100%);
}

.relations-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 2;
}

.relations-diagram {
    position: relative;
    width: 100%;
    height: 600px;
    margin: 0 auto;
    border-radius: 20px;
    background: radial-gradient(circle at center, rgba(201, 169, 110, 0.1) 0%, rgba(12, 19, 27, 0.9) 70%);
    border: 2px solid rgba(201, 169, 110, 0.3);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Conteneur SVG pour les lignes */
.relations-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Nœuds des divinités */
.deity-node {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--accent-gold);
    box-shadow: 
        0 0 20px rgba(201, 169, 110, 0.6),
        0 5px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    transform-origin: center;
}

.deity-node::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: linear-gradient(45deg, transparent, rgba(201, 169, 110, 0.3), transparent);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.deity-node:hover::before {
    opacity: 1;
    animation: rotate 2s linear infinite;
}

.deity-node:hover {
    transform: scale(1.1);
    box-shadow: 
        0 0 30px rgba(201, 169, 110, 0.8),
        0 8px 25px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.deity-node.active {
    transform: scale(1.15);
    box-shadow: 
        0 0 40px rgba(201, 169, 110, 1),
        0 10px 30px rgba(0, 0, 0, 0.7);
    z-index: 11;
}

/* Nom de la divinité */
.deity-name {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    font-size: 1.4rem;
    color: var(--text-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
    white-space: nowrap;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.deity-node:hover .deity-name {
    opacity: 1;
    color: var(--accent-gold);
}

/* Lignes de relation SVG */
.relation-line {
    stroke-width: 2;
    opacity: 0.7;
    transition: all 0.3s ease;
    cursor: pointer;
}

.relation-line.positive {
    stroke: #4ade80; /* Vert pour les relations positives */
    stroke-dasharray: none;
}

.relation-line.negative {
    stroke: #f87171; /* Rouge pour les relations négatives */
    stroke-dasharray: 5,5;
}

.relation-line.neutral {
    stroke: #fbbf24; /* Jaune pour les relations neutres */
    stroke-dasharray: 10,5;
}

.relation-line:hover {
    stroke-width: 4;
    opacity: 1;
    filter: drop-shadow(0 0 8px currentColor);
}

.relation-line.highlighted {
    stroke-width: 4;
    opacity: 1;
    filter: drop-shadow(0 0 8px currentColor);
    animation: pulse 2s ease-in-out infinite;
}

/* Tooltip pour les relations */
.relation-tooltip {
    position: absolute;
    background: rgba(12, 19, 27, 0.95);
    color: var(--text-light);
    padding: var(--spacing-sm);
    border-radius: 8px;
    border: 1px solid var(--accent-gold);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
    font-size: 1.3rem;
    z-index: 100;
    max-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.relation-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.relation-tooltip h4 {
    color: var(--accent-gold);
    font-size: 1.4rem;
    margin-bottom: var(--spacing-xs);
}

.relation-tooltip .relation-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: var(--spacing-xs);
}

.relation-type.positive {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.relation-type.negative {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.relation-type.neutral {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

/* Légende */
.relations-legend {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-light);
    font-size: 1.3rem;
}

.legend-line {
    width: 30px;
    height: 2px;
    border-radius: 1px;
}

.legend-line.positive {
    background: #4ade80;
}

.legend-line.negative {
    background: #f87171;
    background-image: repeating-linear-gradient(
        90deg,
        #f87171 0px,
        #f87171 5px,
        transparent 5px,
        transparent 10px
    );
}

.legend-line.neutral {
    background: #fbbf24;
    background-image: repeating-linear-gradient(
        90deg,
        #fbbf24 0px,
        #fbbf24 10px,
        transparent 10px,
        transparent 15px
    );
}

/* Animations */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.8);
    }
    to { 
        opacity: 1; 
        transform: scale(1);
    }
}

.deity-node {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .deity-relations .section-title {
        font-size: 3rem;
    }
    
    .relations-diagram {
        height: 500px;
        margin: 0 var(--spacing-sm);
    }
    
    .deity-node {
        width: 60px;
        height: 60px;
    }
    
    .deity-name {
        top: 70px;
        font-size: 1.2rem;
    }
    
    .relations-legend {
        gap: var(--spacing-sm);
    }
    
    .legend-item {
        font-size: 1.2rem;
    }
    
    .relation-tooltip {
        max-width: 200px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .relations-diagram {
        height: 400px;
    }
    
    .deity-node {
        width: 50px;
        height: 50px;
    }
    
    .deity-name {
        top: 60px;
        font-size: 1.1rem;
    }
    
    .relations-legend {
        flex-direction: column;
        align-items: center;
    }
}