:root {
    --primary: #4E7387;
    --secondary: #48576A;
    --dark: #233741;
    --highlight: #ff4d37;
    --error: #96151d;
    --bg-light: rgba(255, 255, 255, 0.9);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Base Container */
.deepindivest-container {
    font-family: 'Manrope', sans-serif;
    max-width: 850px; /* von 1000px reduziert */
    margin: 0 auto;
    padding: 15px;
    color: var(--dark);
}

/* Input Section: Flex-Layout Kontext hat flex:2, margin-bottom variiert */
.deepindivest-input-section {
    /*background-color: var(--bg-light);*/
    padding: 5px;
    border-radius: 6px;
    margin-bottom: 15px; /* In Flex-Layout überschrieben */
    /*box-shadow: var(--shadow);*/
}

/* Percentage Input Row */
.input-row-percentage {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
}

.input-row-percentage .input-group {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-row-percentage .input-wrapper {
    justify-content: center;
    width: 100%;
}

.input-row-percentage input {
    text-align: center;
    max-width: 90px;
}

/* Three Column Layout */
.input-row-three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    /*justify-items: stretch;*/
}

.input-group {
    margin-bottom: 1.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    /*align-items: flex-end;*/
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
    /*justify-content: flex-end;*/
}

.input-group input, 
.input-group select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.85rem !important;
    border: none;
    border-bottom: 2px solid var(--primary);
    background-color: rgba(78, 115, 135, 0.1);
    border-radius: 0;
    transition: all 0.2s ease;
    text-align: center;
    max-width: 100px;
}

/* Absolute value styling */
.absolute-value {
    white-space: nowrap;
    color: var(--secondary);
    font-size: 0.8125em;
    text-align: center;
}

/* Interactive States: Focus und Active zusammenfassen */
.input-group input:focus, 
.input-group select:focus,
.input-group input:active {
    outline: none;
    border-bottom-color: var(--highlight);
    box-shadow: 0 2px 0 var(--highlight); /* Subtle underline effect */
}

/* Error State */
.input-group input.input-error {
    border-bottom-color: var(--error);
    background-color: rgba(150, 21, 29, 0.1);
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    display: inline-block;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, -8px);
    background-color: var(--dark);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    box-shadow: var(--shadow);
}

/* Optional Tooltip arrow */
/* [data-tooltip]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent var(--dark) transparent;
    z-index: 101;
} */

/* Chart */
.deepindivest-chart {
    width: 100%;
    height: 550px;
    background-color: white;
    border-radius: 6px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

/* Metrics - alles in einer Box, Flex in Layout */
.deepindivest-metrics {
    background-color: white;
    padding: 1.25rem;
    border-radius: 6px;
    box-shadow: var(--shadow);
    max-width: none; /* max-width aufheben für Flex-Layout */
    margin: 0 auto; /* Falls nicht Flex-Layout, zentriert */
    flex: 1;
}

.metric-item {
    display: flex;
    gap: 0.5em;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.5rem 2rem; /* More balanced spacing */
    transition: all 0.2s ease; /* Smooth hover */
    background-color: rgba(78, 115, 135, 0.08);
    border-radius: 1px;
    /*align-items: center;*/
}

.metric-item:hover {
    background-color: rgba(78, 115, 135, 0.12); /* Subtle interactivity */
}

.metric-label {
    /*font-weight: 400;*/
    color: var(--secondary);
    text-align: left;
    font-size: 0.85em;
}

.metric-value {
    /*font-weight: 400;*/
    color: var(--dark);
    text-align: right;
    font-size: 0.75em !important
}

/* Farbgebung für negative Werte */
.negative-value, 
.metric-value.negative {
    color: var(--highlight);
}

/* Error Message */
#deepindivest-error {
    color: var(--error);
    padding: 8px;
    margin: 10px 0;
    border-radius: 4px;
    background-color: rgba(150, 21, 29, 0.1);
    text-align: center;
    font-size: 0.9em;
}

/* Flex Layout für Inputs + Metrics nebeneinander */
.deepindivest-flex-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 15px;
}

deepindivest-metrics .metric-label,
.deepindivest-metrics .metric-value {
    font-size: 0.75rem;
    font-weight: 400;
}

.deepindivest-input-section label,
.deepindivest-input-section input {
    font-size: 0.75rem;
}

.deepindivest-input-section {
    flex: 2;
    margin-bottom: 0;
}

.deepindivest-metrics {
    flex: 1;
    max-width: none;
}

/* Responsive */
@media (max-width: 768px) {
    .deepindivest-flex-row {
        flex-direction: column;
        max-width: 100%;
    }
    .deepindivest-input-section,
    .deepindivest-metrics {
        max-width: 100%;
        margin-bottom: 7px;
    }

    .input-row-percentage {
        flex-direction: column;
        max-width: 100%;
        gap: 0.5rem;
    }
    
    .input-group input, 
    .input-group select {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.deepindivest-metrics,
.deepindivest-chart {
    animation: fadeIn 0.4s ease-out;
}
