/* ==========================================================================
   Styles für den Vorabpauschale Rechner
   ========================================================================== */

/* --- 1. Haupt-Layout & Container --- */

.container {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.header-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.header-text h1 {
    margin-bottom: 5px;
    font-size: 2rem;
}

.header-text p.subtitle {
    margin: 0;
    font-size: 1rem;
    color: var(--color-text-muted);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-split {
    display: flex;
    align-items: stretch;
    gap: 30px;
    margin-bottom: 40px;
}

.left-col,
.right-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 30px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.left-col p,
.right-col p {
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 0.95rem;
    color: #4b5563;
}

.privacy-notice {
    margin-bottom: 0 !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    color: var(--color-success-bg) !important;
}

/* --- 2. Buttons --- */

.btn-screenshot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #f3f4f6;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-screenshot:hover {
    background-color: #e5e7eb;
}

.btn-screenshot.active {
    background-color: #3b82f6;
    color: white;
    border-color: #2563eb;
}

.connect-with-parqet {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
    padding: 0.75rem 1rem;
    background-color: #009991;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.connect-with-parqet:hover {
    background-color: #5bcec2;
}

.connect-with-parqet img {
    width: 1.6em;
    height: 1.6em;
    margin-block: -0.25em;
}

.action-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-calculate {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
    background-color: var(--color-success-bg);
    color: white;
    font-size: 1.05rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-calculate:not(:disabled):hover {
    background-color: var(--color-success-hover);
}

.btn-calculate:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.btn-disconnect {
    flex: 1;
    padding: 10px;
    background-color: var(--color-danger-bg);
    color: var(--color-danger-text);
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid var(--color-danger-border);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-disconnect:hover {
    background-color: var(--color-danger-hover);
}

#reset-tfs-btn {
    background-color: var(--color-info-bg);
    color: var(--color-info-text);
    border: 1px solid var(--color-info-border);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

#reset-tfs-btn:hover {
    background-color: var(--color-info-hover);
    border-color: var(--color-info-border);
}

/* --- 3. Custom Dropdown (Depotauswahl) --- */

.custom-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: white;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.dropdown-btn:hover {
    background-color: #f9fafb;
}

.dropdown-content {
    position: absolute;
    top: 110%;
    right: 0;
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.1);
}

.dropdown-content.show {
    display: flex;
}

.dropdown-content label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    font-size: 0.95rem;
    color: #374151;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.dropdown-content label:hover {
    background-color: #f3f4f6;
}

.dropdown-content input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* --- 4. UI-Elemente (Spinner, Tooltip, Censor) --- */

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

body.censored .censor-target {
    opacity: 0.8;
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

body.censored .censor-target-light {
    opacity: 0.9;
    filter: blur(4px);
    user-select: none;
}

.info-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    cursor: help;
}

.info-tooltip .tooltiptext {
    position: absolute;
    top: 150%;
    left: 50%;
    z-index: 9999;
    width: 260px;
    padding: 10px 12px;
    background-color: #1f2937;
    color: #fff;
    font-size: 0.8rem;
    font-weight: normal;
    text-align: left;
    text-transform: none;
    line-height: 1.4;
    white-space: normal;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    visibility: hidden;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.2s;
}

.info-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #1f2937 transparent;
}

.info-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* --- 5. Tabellen (Portfolio-Ansichten) --- */

.portfolio-section {
    margin-bottom: 25px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.portfolio-header {
    padding: 12px 20px;
    background-color: #1f2937;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    font-size: 0.95rem;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background-color: #f9fafb;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    vertical-align: bottom;
}

th:first-child,
td:first-child {
    padding-left: 15px;
    text-align: left;
    vertical-align: bottom;
}

.portfolio-section thead th:nth-child(2),
.portfolio-section tbody td:nth-child(2) {
    text-align: left;
    width: 250px;
    max-width: 250px;
    white-space: nowrap;
}

.portfolio-section tbody tr:not(.sum-row):hover {
    background-color: #f1f5f9;
}

th:last-child,
td:last-child {
    background-color: #f9fafb;
    color: #111827;
    font-weight: bold;
    border-left: 1px solid #e5e7eb;
    padding-right: 15px;
}

.portfolio-section .sum-row td:last-child {
    background-color: #e2e8f0 !important;
    color: #111827 !important;
}

th:last-child {
    background-color: #f3f4f6 !important;
}

.empty-cell {
    color: #9ca3af;
}

.sum-row td {
    text-align: right !important;
}

.sum-row td:first-child {
    text-align: left !important;
}

.asset-name {
    display: block;
    min-width: 250px;
    max-width: 500px;
    white-space: normal;
    overflow: hidden;
}

/* Dropdown innerhalb der Tabelle (Art des Fonds) */
select {
    width: 100%;
    height: 30px;
    box-sizing: border-box;
    padding: 4px;
    background-color: white;
    color: #4b5563;
    font-size: 0.85rem;
    border: 1px solid var(--color-border-default);
    border-radius: 4px;
    cursor: pointer;
}

.year-hint {
    display: block;
    margin-bottom: 4px;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: normal;
    text-transform: none;
}

select.unknown-warning {
    background-color: var(--color-danger-bg);
    color: var(--color-danger-text);
    border: 1px solid var(--color-danger-border);
    box-shadow: 0 0 0 1px var(--color-danger-border);
}

select.manual-override {
    background-color: var(--color-info-bg);
    color: var(--color-info-text);
    border: 1px solid var(--color-info-border);
    box-shadow: 0 0 0 1px var(--color-info-border);
}

/* --- 6. Tabellen (Gesamtsumme) --- */

.grand-total-section {
    display: none;
    margin-top: 30px;
    padding: 5px 20px 15px 20px;
    background-color: var(--color-success-bg);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.grand-total-table {
    width: 100%;
    background-color: transparent;
}

.grand-total-table th,
.grand-total-table td {
    padding: 10px;
    background-color: transparent !important;
    color: white;
    white-space: nowrap;
    border: none;
}

.grand-total-table th {
    font-size: 0.95rem;
    text-transform: none;
    vertical-align: bottom;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.grand-total-table th:first-child {
    width: 250px;
    padding-left: 15px;
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    text-align: left;
    vertical-align: bottom;
    border-bottom: none !important;
}

.grand-total-table td {
    font-size: 1.2rem;
    font-weight: 600;
}

.grand-total-table td:first-child {
    padding-left: 15px;
}

.grand-total-table th:last-child {
    padding-right: 15px;
}

.grand-total-table td:last-child {
    background-color: transparent !important;
    color: white !important;
    font-weight: bold;
    border-left: none !important;
    padding-right: 15px;
}

.grand-total-section .year-hint {
    color: rgba(255, 255, 255, 0.8);
}