/* ============================================
   Phytoverse Ellenberg — Styles
   ============================================ */

.pve-block {
    font-family: inherit;
    position: relative;
    padding: 16px 0;
}

/* Bouton légende */
.pve-legend-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
}
.pve-legend-btn:hover {
    border-color: #4a7c6f;
    color: #4a7c6f;
    background: #f0f7f5;
}

/* Grille des widgets */
.pve-widgets {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.pve-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.pve-widget-wide {
    flex: 1;
    min-width: 220px;
    align-items: stretch;
}

.pve-wlabel {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.pve-wval {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.pve-wdesc {
    font-size: 11px;
    color: #888;
    text-align: center;
    font-style: italic;
}

/* ---- SOLEIL ---- */
.pve-sun-svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* ---- THERMOMÈTRE ---- */
.pve-thermo-svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* ---- HUMIDITÉ ---- */
.pve-hum-tube-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pve-hum-tube {
    width: 24px;
    height: 100px;
    border: 2px solid #90CAF9;
    border-radius: 12px;
    background: #f0f8ff;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.pve-hum-fill {
    width: 100%;
    background: linear-gradient(to top, #1565C0, #64B5F6);
    border-radius: 0 0 10px 10px;
    transition: height 0.6s ease;
}

.pve-hum-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-align: center;
}

.pve-inondee  { background: #E3F2FD; color: #1565C0; }
.pve-amphibie { background: #E8F5E9; color: #2E7D32; }
.pve-aquatique{ background: #E0F2F1; color: #00695C; }

/* ---- BARRES DÉGRADÉ (pH + Nutriments) ---- */
.pve-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pve-bar-edge {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    min-width: 55px;
}

.pve-bar-edge:last-child {
    text-align: right;
}

.pve-bar-wrap {
    position: relative;
    flex: 1;
    padding-top: 28px;
}

.pve-bar {
    height: 18px;
    border-radius: 9px;
    width: 100%;
}

.pve-bar-ph {
    background: linear-gradient(to right,
        #E53935,
        #FF7043,
        #FFA726,
        #FFF176,
        #AED581,
        #66BB6A,
        #2E7D32
    );
}

.pve-bar-n {
    background: linear-gradient(to right,
        #9E9E9E,
        #BDBDBD,
        #FFD54F,
        #FFB300,
        #81D4FA,
        #1976D2
    );
}

/* Triangle indicateur */
.pve-tri-wrap {
    position: absolute;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.pve-tri-val {
    background: #333;
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pve-tri-arrow {
    color: #333;
    font-size: 10px;
    line-height: 1;
    margin-top: -2px;
}

/* ---- CAROUSEL TEXTURE ---- */
.pve-carousel {
    display: flex;
    gap: 4px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
}

.pve-car-side {
    flex: 1;
    border-radius: 4px;
    opacity: 0.6;
}

.pve-car-center {
    flex: 2;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.pve-car-center span {
    background: rgba(0,0,0,0.55);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ---- LÉGENDE MODALE ---- */
.pve-legend-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pve-legend-box {
    background: white;
    border-radius: 12px;
    padding: 28px;
    max-width: 520px;
    width: 90%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.pve-legend-box h3 {
    margin: 0 0 16px;
    font-size: 16px;
    color: #333;
}

.pve-legend-box dl {
    margin: 0;
}

.pve-legend-box dt {
    font-weight: 700;
    color: #444;
    margin-top: 12px;
    font-size: 13px;
}

.pve-legend-box dd {
    margin: 4px 0 0 0;
    color: #666;
    font-size: 12px;
    line-height: 1.5;
}

.pve-legend-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #eee;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pve-legend-close:hover {
    background: #ddd;
}

.pve-source {
    margin-top: 16px;
    font-size: 11px;
    color: #aaa;
    font-style: italic;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .pve-widgets {
        gap: 16px;
    }
    .pve-widget-wide {
        min-width: 100%;
    }
}
