/* Conteneur principal */
#passiveTreeUI
{
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    overflow: visible;
    flex-direction: column;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
}

/* Affichage des points */
#passivePointsDisplay {
    text-transform: uppercase;
    color:#a5a5a5;
    font-weight: bold;
    font-size: 2em;
    text-align: center;
    margin: 10px 0 15px 0;
    position: relative;
    z-index: 1001;
}

/* Grille des passifs */
#passiveTreeGrid {
    display: grid;
    position: relative;
    overflow: visible;
    transform-origin: 0 0;
    transition: transform 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
    cursor: grab;
    width: 100%;
    height: 100%;
   /* min-height: 300px;
    min-width: 300px;*/
}

#passiveTreeGrid.grabbing {
    cursor: grabbing;
}

/* Nœuds de passifs */
.passive-node {
    width: 60px;
    height: 60px;
    background-color: rgba(51, 51, 51, 0.8);
    border: 2px solid #555;
    border-radius: 8px;
    display: flex !important;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    user-select: none;
    box-sizing: border-box;
    border-radius: 50%;
}

.passive-node:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* États des nœuds */
.passive-node.unlocked {
    background-color: rgba(0, 255, 98, 1);
    border-color: rgb(64, 186, 125);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.771);
}

.passive-node.available {
    background-color: rgba(33, 76, 22, 0.8);
    border-color: #6a5;
    box-shadow: 0 0 8px rgba(1, 154, 1, 0.3);
}

.passive-node.unavailable {
    background-color: rgba(85, 34, 34, 0.8);
    border-color: #844;
    cursor: not-allowed;
}

.passive-node.empty {
    background-color: transparent;
    border: 1px dashed rgba(51, 51, 51, 0.5);
    cursor: default;
}

/* Tooltips */
.passive-node-tooltip {
    position: absolute;
    transform: translate(-50%, 100%);
    background: rgba(10, 10, 15, 0.98);
    border: 1px solid #555;
    border-radius: 6px;
    padding: 12px;
    color: #eee;
    font-size: 14px;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    min-width: 220px;
    max-width: 280px;
    text-align: center;
    z-index: 1100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    transform-origin: center;
    will-change: opacity, visibility, top, left;
}


.passive-node:hover .passive-node-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Styles spécifiques pour les tooltips selon l'état */
.passive-node.unlocked .passive-node-tooltip {
    border-color: rgb(0, 255, 128);
    background: rgba(20, 40, 20, 0.98);
}

.passive-node.available .passive-node-tooltip {
    border-color: #6a5;
    background: rgba(30, 40, 20, 0.98);
}

.passive-node.unavailable .passive-node-tooltip {
    border-color: #844;
    background: rgba(40, 20, 20, 0.98);
}

/* Contenu des tooltips */
.passive-node-tooltip strong {
    color: white;
    font-size: 15px;
    display: block;
    margin-bottom: 6px;
}

.passive-node-tooltip .cost {
    color: gold;
    font-weight: bold;
    margin-top: 6px;
}

.passive-node-tooltip .effect {
    color: #aaf;
    font-style: italic;
    margin-top: 4px;
}

/* Contrôles de navigation */
.passive-tree-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 1200;
}

.passive-tree-controls button {
    background: rgba(30, 30, 40, 0.8);
    border: 1px solid #555;
    color: #ddd;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.passive-tree-controls button:hover {
    background: rgba(50, 50, 70, 0.9);
    color: white;
}

/* Optimisations pendant le déplacement */
#passiveTreeGrid.grabbing .passive-node-tooltip {
    display: none !important;
}
#passiveTreeGrid.panning {
    transition: none !important;
    cursor: grabbing;
}

#passiveTreeGrid.panning .passive-node:not(.visible) {
    opacity: 0.7;
    transition: opacity 0.1s ease;
}

#passiveTreeGrid.panning .passive-node {
    transition: none;
}

/* Optimisation pendant le déplacement */
#passiveTreeGrid.panning .passive-node-tooltip {
    display: none !important;
}

/* ICONS*/
.passive-node-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.passive-node.unlocked .passive-node-icon {
    filter: brightness(1.2) drop-shadow(0 0 2px rgba(0, 255, 0, 0.7));
}

.passive-node.available .passive-node-icon {
    filter: brightness(1.1) drop-shadow(0 0 2px rgba(0, 200, 0, 0.5));
}

.passive-node.unavailable .passive-node-icon {
    filter: grayscale(0.8) brightness(0.7);
}

/* Styles pour le contenu du nœud *//*
.node-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}*/

/* Styles pour les coordonnées */
.node-coordinates {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.node-coordinates.empty {
    color: rgba(255, 255, 255, 0.3);
}

/* Ajustements pour les icônes */
.passive-node-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* Styles différents selon l'état */
.passive-node.unlocked .node-coordinates {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 3px rgba(0, 255, 0, 0.5);
}

.passive-node.available .node-coordinates {
    color: rgba(255, 255, 255, 0.7);
}

.passive-node.unavailable .node-coordinates {
    color: rgba(255, 255, 255, 0.5);
}

.tooltip-text
{
    margin-top:5px;
    display:flex;
    align-items:center;
    justify-content: center;
    gap:5px;
    font-size: 1em;
}

.tooltip-text img
{
    width:20px;
    height:20px;
}

.tooltip-name
{
    font-weight:bold;
    color:#fff;
    margin-bottom:3px
}

.tooltip-description
{
    color:#ccc;
    margin:10px 0
}

.tooltip-cost
{
    color:gold
}

/* Couleurs de bordure par rareté */
.passive-node.common {
    border-color: #6b7280; /* Gris */
}

.passive-node.uncommon {
    border-color: #10b981; /* Vert */
    background-color: #10b981;
}

.passive-node.rare {
    border-color: #3b82f6; /* Bleu */
    background-color: #3b82f6;
}

.passive-node.legendary {
    border-color: #f69c3b; /* Bleu */
    background-color: #f69c3b;
}

/* Vous pouvez aussi styliser différemment selon l'état ET la rareté */
.passive-node.unlocked.common {
    box-shadow: 0 0 5px #6b7280;
}

.passive-node.available.uncommon {
    box-shadow: 0 0 8px #10b981;
}

.passive-node.unlocked.rare {
    box-shadow: 
    0 0 10px #3b82f6,
    0 0 17px #3b82f6,
    0 0 25px #3b82f6,
    0 0 30px #3b82f6,
    0 0 35px #3b82f6,
    0 0 40px #3b82f6
    ;
}

.passive-node.unlocked.uncommon
{
    box-shadow: 
    0 0 10px #10b981,
    0 0 12px #10b981,
    0 0 15px #10b981,
    0 0 17px #10b981,
    0 0 20px #10b981
    ;
}

.passive-node.unlocked.legendary
{
    box-shadow: 
    0 0 10px #f69c3b,
    0 0 12px #f69c3b,
    0 0 15px #f69c3b,
    0 0 17px #f69c3b,
    0 0 20px #f69c3b
    ;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.tooltip-rarity {
    text-transform: capitalize;
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 10px;
}

.tooltip-rarity.common {
    background-color: #6b7280;
    color: white;
}

.tooltip-rarity.uncommon {
    background-color: #10b981;
    color: white;
}

.tooltip-rarity.rare {
    background-color: #3b82f6;
    color: white;
}

.tooltip-rarity.legendary {
    background-color: #f69c3b;
    color: white;
}


/* Styles pour les connexions entre les nœuds */
.passive-connection {
    position: absolute;
    background-color: rgba(100, 100, 100, 0.5); /* Gris par défaut */
    height: 3px;
    transform-origin: 0 50%;
    z-index: -1;
    pointer-events: none;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.passive-connection.available {
    background: linear-gradient(90deg, rgba(100,255,100,0.7), rgba(100,255,100,0.3));
    box-shadow: 0 0 5px rgba(100, 255, 100, 0.5);
}

.passive-connection.unlocked {
    background-color: rgba(0, 255, 0, 0.7); /* Vert lorsque connecté */
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

#passiveTreeGrid {
    overflow: visible;
    position: relative;
}

#centerTreeButton {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1001;
    padding: 8px 16px;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    transition: all 0.2s ease;
}

#centerTreeButton:hover {
    background-color: #444;
    transform: scale(1.05);
}

#closePassiveTree {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    color: white;
    background-color: #ff4444;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.2s ease;
    border: 2px solid #ff0000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#closePassiveTree:hover {
    background-color: #ff0000;
    transform: scale(1.1);
}

#closePassiveTree:active {
    transform: scale(0.95);
}