/*
* Diese Datei wurde mit hilfe von GEMINI PRO erstellt, 
* da meinen eigegen CSS Skills nicht gereicht haben mein Konzept
* schon in HTML und CSS umzusetzen. 
* Weil mir aber einer wirklich darstellung der Daten wichtig war 
* habe ich mich deshalt trotzdem gegen Figma entschieden habe.
*/

@import url(style.css);

.morphology-section {
    background-color: var(--color-forest); /* Dunkelgrün */
    color: white;
    padding: 6rem 2rem 10rem 2rem;
    position: relative;
    /* Damit die Bubbles nicht rausfliegen */
    overflow: hidden; 
}

/* Flexbox Layout: Text links, Chart rechts */
.viz-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4rem;
}

.viz-text {
    flex: 1;
    min-width: 300px;
    z-index: 10; /* Text über den Blasen */
}

.viz-chart-area {
    flex: 1.5;
    min-width: 300px;
    height: 500px; /* Der Eltern-Container hat Höhe */
    position: relative;
    z-index: 5; /* Sicherstellen, dass er weit oben liegt */
}

.chart-wrapper {
    width: 100%;
    height: 100%; 
    display: block;
}

.search-wrapper {
    margin: 1.5rem 0;
    position: relative;
    max-width: 300px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
}

#bubble-search {
    width: 100%;
    padding: 12px 15px 12px 45px; /* Platz für Icon lassen */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#bubble-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#bubble-search:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--color-accent);
    box-shadow: 0 0 15px rgba(224, 159, 62, 0.3);
}

.suggestions-list {
    position: absolute;
    top: 100%; /* Direkt unter dem Input */
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95); /* Fast deckend weiß */
    border-radius: 15px;
    padding: 10px 0;
    margin-top: 10px;
    list-style: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 100; /* Muss über allem liegen */
    max-height: 200px;
    overflow-y: auto; /* Scrollbar wenn zu viele Ergebnisse */
    
    /* Animation beim Einblenden */
    transform-origin: top;
    transition: all 0.2s ease;
}

/* Versteckt Zustand */
.suggestions-list.hidden {
    opacity: 0;
    transform: scaleY(0);
    pointer-events: none;
}

/* Einzelner Listen-Eintrag */
.suggestions-list li {
    padding: 10px 20px;
    color: var(--color-forest);
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.2s;
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:hover {
    background: var(--color-lime); /* Hellgrün beim Drüberfahren */
    font-weight: 600;
}

/* Scrollbar verschönern (optional) */
.suggestions-list::-webkit-scrollbar {
    width: 6px;
}
.suggestions-list::-webkit-scrollbar-thumb {
    background-color: var(--color-forest-light);
    border-radius: 10px;
}

.highlight-gold {
    color: var(--color-accent);
}

.instruction {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.icon-small { font-size: 1.2rem; }

/* Info Panel (Das Schild, das beim Hovern aufgeht) */
.info-panel {
    margin-top: 2rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 1.5rem;
    border-radius: 15px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.info-panel.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.big-num {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--color-accent);
    font-weight: 700;
    margin-right: 10px;
}

/* Übergang zur nächsten Farbe (Braun) */
.shape-fill-trunk {
    fill: var(--color-trunk);
}

/* Tooltip (falls wir einen Maus-Verfolger wollen) */
.d3-tooltip {
    position: absolute;
    background: white;
    color: var(--color-text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.2s;
}