/* Styles pour l'animation des lignes croisées */
.lines-chart {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 25px;
    transition: all 0.3s ease;
    height: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

/* Effet de brume sur la carte */
.lines-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.3) 100%);
    z-index: -1;
    border-radius: 24px;
}

/* Effet de bordure subtil */
.lines-chart::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.lines-chart h3.chart-title {
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    color: #000B10;
}

.lines-container {
    position: relative;
    height: 180px;
    margin: 20px auto;
    width: 85%;
    background: rgba(245, 245, 245, 0.5);
    border-radius: 8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    opacity: 0.4;
}

.grid-line {
    height: 1px;
    width: 100%;
    background: #aaa;
}

.data-line {
    position: absolute;
    height: 4px;
    width: 100%;
    border-radius: 2px;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
}

.cpa-line {
    background: linear-gradient(to right, #7C89FF, #9BA3FF);
    top: 20%;
    box-shadow: 0 0 10px rgba(124, 137, 255, 0.3);
    animation: lineFromTop 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.spend-line {
    background: linear-gradient(to right, #4CAF50, #66BB6A);
    bottom: 30%;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    animation: lineFromBottom 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes lineFromTop {
    0% {
        transform: translateY(-20px) scaleX(0);
        opacity: 0;
    }
    30% {
        transform: translateY(0) scaleX(0.2);
        opacity: 0.8;
    }
    100% {
        transform: translateY(50px) scaleX(1);
        opacity: 1;
    }
}

@keyframes lineFromBottom {
    0% {
        transform: translateY(20px) scaleX(0);
        opacity: 0;
    }
    30% {
        transform: translateY(0) scaleX(0.2);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-40px) scaleX(1);
        opacity: 1;
    }
}

.line-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.line-label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.label-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    display: inline-block;
}

.cpa-color {
    background: #7C89FF;
}

.spend-color {
    background: #4CAF50;
}

.axis-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #777;
    padding: 0 15px;
}

.axis-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.lines-chart-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #555;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.8s ease-out 2s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.data-point {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    z-index: 2;
}

.cpa-point {
    background: #7C89FF;
    animation: pointAppear 0.5s ease-out 2.2s forwards;
}

.spend-point {
    background: #4CAF50;
    animation: pointAppear 0.5s ease-out 2.2s forwards;
}

@keyframes pointAppear {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Points de départ et d'arrivée */
.cpa-start {
    top: 20%;
    left: 5%;
}

.cpa-end {
    top: 70%;
    right: 5%;
}

.spend-start {
    bottom: 30%;
    left: 5%;
}

.spend-end {
    bottom: 70%;
    right: 5%;
}

/* Responsive */
@media (max-width: 768px) {
    .lines-container {
        height: 150px;
    }
    
    .line-labels {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
