/* =========================================
   1. GRUNDLAGEN & VARIABLEN
   ========================================= */
:root {
    --bg-color: #F7931A; /* Bitcoin Orange */
    --container-bg: #000000; /* Schwarz */
    --text-color: #e0e0e0;
    --accent-blue: #1e90ff;
    --accent-green: #28a745;
    --accent-hover: #1c7ed6;
    --border-color: #444;
    --input-bg: #1a1a1a; 
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --disabled-color: #555;
    
    /* Wealth Colors */
    --color-gold: #FFD700;
    --color-real-estate: #C19A6B; 
    --color-equities: #4682B4; 
    --color-bonds: #A9A9A9; 
    --color-money: #90EE90; 
    --color-art: #9370DB; 
    --color-btc: #F7931A; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. HEADER
   ========================================= */
header {
    background-color: var(--container-bg);
    padding: 0.8rem 1.5rem; 
    display: flex;
    align-items: center;
    justify-content: space-between; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left { 
    display: flex; 
    align-items: center;
    z-index: 2; 
    flex: 3; 
    overflow: hidden; 
}

.header-nav-links {
    display: flex;
    flex-direction: row;
    gap: 30px; 
    align-items: center;
    overflow-x: auto; 
    padding-bottom: 5px; 
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}
.header-nav-links::-webkit-scrollbar { display: none; }

.header-nav-links .header-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem; 
    transition: color 0.3s;
    white-space: nowrap; 
}
.header-nav-links .header-link:hover { color: var(--accent-blue); }

.header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 1.4rem;
    margin: 0;
    white-space: nowrap; 
    z-index: 1;
    pointer-events: none; 
}

.header-right { 
    display: flex; 
    justify-content: flex-end;
    z-index: 2;
    flex: 0;
    min-width: 50px;
}

.hamburger-menu {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px; 
    margin: -15px; 
    position: relative;
    z-index: 2001;
}
.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
}

/* =========================================
   3. SIDEBAR
   ========================================= */
.side-panel {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 2000;
    top: 0;
    right: 0;
    background-color: #111;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
}

.side-panel.open { width: 280px; }

.side-panel a {
    padding: 10px 15px 10px 32px;
    text-decoration: none;
    font-size: 1.1rem;
    color: #818181;
    display: block;
    transition: 0.3s;
    border-bottom: 1px solid #222; 
}
.side-panel a:hover { color: #f1f1f1; background-color: #1a1a1a; }
.side-panel .close-btn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
    cursor: pointer;
    padding: 10px;
    border: none;
}

/* =========================================
   4. MAIN LAYOUT
   ========================================= */
main {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    align-items: flex-start; 
}

#zitat-box-links, #zitat-box-rechts {
    flex: 1;
    background-color: var(--container-bg);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 300px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px); 
}
#zitat-box-links { overflow-y: auto; }
#zitat-box-rechts { overflow: hidden; }

.quotes-container {
    flex: 1; 
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden; 
    mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
}

#hauptinhalt-wrapper { flex: 2; min-width: 400px; }

.quote-item {
    background-color: #1a1a1a;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #333;
    font-size: 0.9rem;
    flex-shrink: 0; 
}
.quote-item blockquote { font-style: italic; margin-bottom: 5px; }
.quote-item cite { display: block; text-align: right; font-size: 0.8rem; color: #888; }

#bitcoin-chart-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 400px; 
    margin-top: 10px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #333;
    background-color: #000000; 
}
.tradingview-widget-container { flex: 1; width: 100% !important; height: 100% !important; }
.tradingview-widget-container iframe { height: 100% !important; width: 100% !important; }

#satoshi-price-container {
    background-color: #1a1a1a;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    color: var(--accent-green);
    font-size: 1.1rem;
    margin-top: auto; 
    border: 1px solid #333;
    flex-shrink: 0; 
    z-index: 10;
    box-shadow: 0 -5px 10px rgba(0,0,0,0.2);
}

/* =========================================
   5. RECHNER & CONTENT
   ========================================= */
#eingabe-ergebnis-bereich, #timeline-section {
    background-color: var(--container-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.rechner-header h2 {
    margin-bottom: 10px; 
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 10px;
    font-size: 1.6rem;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    position: relative;
    text-align: center;
}

/* Styles für Mode-Toggle Buttons */
.mode-toggle-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.mode-btn {
    background: transparent;
    border: 1px solid #555;
    color: #888;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
.mode-btn:hover { border-color: #aaa; color: #ccc; }
.mode-btn.active {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(30, 144, 255, 0.3);
}

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.input-field { display: flex; flex-direction: column; gap: 8px; }
.input-field-full { grid-column: 1 / -1; margin-top: 15px; }
label { font-size: 0.95rem; color: #ccc; font-weight: 500; }

input[type="number"], input[type="text"], select {
    background-color: var(--input-bg); border: 1px solid var(--border-color); color: #fff;
    padding: 12px; border-radius: 6px; font-size: 1rem; text-align: center; 
    appearance: none; -webkit-appearance: none; cursor: pointer;
}
select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; 
}

/* INFO ICON & BOX UPDATES */
.info-icon { 
    font-size: 0.6em; 
    cursor: help; 
    background: var(--accent-blue); 
    color: #fff; 
    border-radius: 50%; 
    width: 24px; 
    height: 24px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
}

.info-box { 
    display: none; 
    position: absolute; 
    /* Positioniert sich relativ zum Wrapper */
    top: 100%; 
    margin-top: 10px;
    left: 50%; 
    transform: translateX(-50%); 
    background: #222; 
    padding: 15px; 
    border-radius: 5px; 
    font-size: 0.9rem; 
    z-index: 2000; 
    width: 250px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.8); 
    border: 1px solid #444; 
    line-height: 1.4;
    white-space: normal; /* Textumbruch erzwingen */
}

/* Der kleine Pfeil an der Box (optional, aber hübsch) */
.info-box::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #222 transparent;
}

.info-icon:hover + .info-box { display: block; }

/* WEALTH VISUALIZER */
.wealth-control-panel { margin-bottom: 20px; background: #151515; padding: 15px; border-radius: 8px; border: 1px solid #333; }
.wealth-row { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; }
.wealth-row:last-child { margin-bottom: 0; }

.wealth-label { 
    font-weight: bold; 
    color: #fff; 
    margin-right: 10px; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    /* relative ist hier wichtig für die Infobox */
    position: relative; 
}

.wealth-btn { padding: 8px 16px; width: 80px; background: #222; border: 1px solid #444; color: #ccc; border-radius: 5px; cursor: pointer; transition: all 0.2s; font-weight: 500; text-align: center; }
.wealth-btn:hover { background: #333; border-color: #666; }
.wealth-btn.active { background: var(--accent-blue); color: white; border-color: var(--accent-blue); box-shadow: 0 0 8px rgba(30, 144, 255, 0.4); }
.wealth-btn.heute-btn { border-color: var(--accent-green); color: var(--accent-green); }
.wealth-btn.heute-btn:hover { background-color: rgba(40, 167, 69, 0.1); }
.wealth-btn.heute-btn.active { background-color: var(--accent-green); color: white; }
.wealth-diagram-container { position: relative !important; width: 100%; height: 500px; margin-top: 20px; background: #0a0a0a; border-radius: 4px; border: 1px solid #333; overflow: hidden; display: block; }

.wealth-cube { 
    position: absolute; 
    border: 1px solid rgba(0,0,0,0.5); 
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1); 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    color: #000; 
    font-weight: bold; 
    font-size: 0.9rem; 
    overflow: hidden; 
    box-sizing: border-box; 
    border: 3px solid #000;
    padding: 2px;
}
.wealth-cube span.label { display: block; margin-bottom: 2px; font-size: 0.9em; text-shadow: 0 0 5px rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 95%; }
.wealth-cube span.val { font-size: 0.85em; opacity: 0.9; }

.wealth-cube.flat-box {
    flex-direction: row; 
    gap: 8px;            
    align-items: center;
    justify-content: center;
}
.wealth-cube.flat-box span.label { margin-bottom: 0; margin-right: 0; }

.cube-btc { background-color: var(--color-btc); color: white !important; border: 2px solid #fff; z-index: 10; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5); }
.cube-gold { background-color: var(--color-gold); }
.cube-real-estate { background-color: var(--color-real-estate); color: white !important; }
.cube-equities { background-color: var(--color-equities); color: white !important; }
.cube-bonds { background-color: var(--color-bonds); color: #000; }
.cube-money { background-color: var(--color-money); }
.cube-art { background-color: var(--color-art); color: white !important; }

.wealth-cube.small-box span { font-size: 0.75em; line-height: 1.1; }
.wealth-cube.small-box span.label { margin-bottom: 1px; }
.wealth-cube.tiny-box span.label { display: none; }

.wealth-tooltip { position: absolute; background: rgba(0, 0, 0, 0.9); color: white; padding: 8px 12px; border-radius: 5px; font-size: 0.9rem; pointer-events: none; z-index: 1000; box-shadow: 0 4px 10px rgba(0,0,0,0.5); border: 1px solid var(--accent-blue); white-space: nowrap; transform: translate(-50%, -120%); transition: opacity 0.2s; opacity: 0; }
.wealth-tooltip.visible { opacity: 1; }
.wealth-summary { text-align: center; margin-top: 15px; padding: 10px; background: #1a1a1a; border-radius: 5px; border-top: 2px solid #333; font-size: 0.95rem; color: #aaa; }
.highlight-price { color: var(--accent-green); font-size: 1.3em; font-weight: bold; display: block; margin-top: 5px; color: #fff; margin-bottom: 10px;}
.total-marketcap-display { margin-top: 10px; font-size: 0.9rem; color: #888; border-top: 1px dashed #444; padding-top: 10px; display: block; }

/* QUIZ */
.quiz-container { max-width: 600px; margin: 0 auto; text-align: center; padding: 20px 0; }
.quiz-question-box { margin-bottom: 30px; }
.quiz-question-text { font-size: 1.3rem; font-weight: bold; margin-bottom: 25px; color: #fff; }
.quiz-options { display: flex; justify-content: center; gap: 20px; margin-bottom: 30px; }
.quiz-point { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #555; background-color: #222; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #888; }
.quiz-point:hover { border-color: var(--accent-blue); background-color: #333; }
.quiz-point.selected { background-color: var(--accent-blue); color: #fff; border-color: var(--accent-blue); transform: scale(1.1); box-shadow: 0 0 15px rgba(30, 144, 255, 0.5); }
.quiz-labels { display: flex; justify-content: space-between; padding: 0 20px; font-size: 0.8rem; color: #888; margin-top: -20px; margin-bottom: 30px; }
.quiz-next-btn { padding: 12px 30px; font-size: 1.1rem; border: none; border-radius: 8px; background-color: var(--accent-green); color: white; cursor: pointer; font-weight: bold; transition: all 0.3s; float: right; }
.quiz-next-btn:disabled { background-color: var(--disabled-color); cursor: not-allowed; opacity: 0.5; }
.quiz-result-box { background-color: #222; padding: 30px; border-radius: 10px; border: 2px solid var(--accent-blue); margin-top: 20px; animation: fadeIn 0.5s; }

/* TIMELINE */
.timeline-container { position: relative; max-width: 100%; margin: 40px auto; padding: 20px 0; }
.timeline-container::after { content: ''; position: absolute; width: 4px; background-color: var(--accent-blue); top: 0; bottom: 0; left: 50%; margin-left: -2px; border-radius: 2px; }
.timeline-item { padding: 10px 40px; position: relative; background-color: inherit; width: 50%; box-sizing: border-box; }
.timeline-item.left { left: 0; text-align: right; }
.timeline-item.right { left: 50%; text-align: left; }
.timeline-item::after { content: ''; position: absolute; width: 20px; height: 20px; right: -10px; background-color: var(--container-bg); border: 4px solid var(--accent-green); top: 25px; border-radius: 50%; z-index: 1; }
.timeline-item.right::after { left: -10px; right: auto; }
.timeline-item.no-marker::after { display: none !important; }
.timeline-content { padding: 20px; background-color: #1a1a1a; position: relative; border-radius: 6px; border: 1px solid #333; transition: transform 0.3s; }
.timeline-content:hover { transform: scale(1.02); border-color: var(--accent-blue); }
.timeline-date { display: inline-block; background: var(--accent-blue); color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 0.85rem; font-weight: bold; margin-bottom: 10px; }
.timeline-content h3 { margin-bottom: 8px; color: var(--accent-green); }
.timeline-content p { font-size: 0.9rem; color: #ccc; margin-bottom: 10px; }
.timeline-content.large-text p { font-size: 1.15rem; line-height: 1.7; color: #e0e0e0; }
.timeline-link { display: inline-block; color: var(--accent-blue); text-decoration: none; font-weight: bold; font-size: 0.9rem; }
.timeline-link:hover { text-decoration: underline; }
.year-marker { text-align: center; position: relative; z-index: 2; margin: 40px 0; }
.year-marker span { background: var(--bg-color); color: white; padding: 8px 16px; border-radius: 20px; font-weight: bold; border: 2px solid var(--accent-blue); font-size: 1.2rem; }

/* RESULT GRID */
.result-box { margin-top: 40px; background-color: #111; padding: 20px; border-radius: 8px; text-align: center; }
.result-row { margin-bottom: 12px; padding: 12px 15px; background: #1a1a1a; border-radius: 6px; border: 1px solid #2a2a2a; display: grid; grid-template-columns: 1.4fr 1.2fr 0.8fr 1.2fr; align-items: center; gap: 10px; }
.result-row.nominal-row { grid-template-columns: 1.4fr 1.2fr 0.8fr 1.2fr; }
.result-label { text-align: left; font-weight: normal; color: #ccc; }
.result-value { text-align: center; font-weight: bold; color: #fff; position: relative; cursor: help; }
.cagr-display { text-align: center; font-size: 0.9rem; color: var(--accent-blue); font-weight: 500; }
.percentage-change { text-align: right; font-size: 0.9em; color: #888; font-weight: normal; white-space: nowrap; }
.btc-tooltip-box { visibility: hidden; opacity: 0; position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background-color: #000; color: var(--accent-green); padding: 8px 12px; border-radius: 5px; font-size: 0.85rem; white-space: nowrap; border: 1px solid #444; box-shadow: 0 5px 10px rgba(0,0,0,0.5); z-index: 100; transition: opacity 0.2s; }
.btc-tooltip-box::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: #444 transparent transparent transparent; }
.result-value:hover .btc-tooltip-box { visibility: visible; opacity: 1; }
.result-item { display: block !important; padding: 10px; margin-bottom: 15px; background: #222; border-top: 3px solid var(--warning-color); text-align: center; color: #ddd; }
.positive-value { color: var(--accent-green); }
.negative-value { color: var(--danger-color); }
.validation-message { color: var(--danger-color); font-weight: bold; margin-top: 10px; text-align: center; }
.fallback-warning { color: var(--warning-color); margin-top: 15px; font-style: italic; text-align: center; }

.phase-separator { margin: 20px 0; border-top: 1px dashed #444; position: relative; text-align: center; }
.phase-separator span { background: #111; padding: 0 10px; position: relative; top: -10px; color: #888; font-size: 0.8em; }

.inflation-toggle-group { display: flex; gap: 15px; margin-top: 5px; }
.inflation-toggle-group input[type="radio"] { display: none; }
.inflation-option { flex: 1; background-color: #1a1a1a; border: 2px solid #333; border-radius: 8px; padding: 15px; cursor: pointer; transition: all 0.2s ease; text-align: center; display: flex; flex-direction: column; justify-content: center; opacity: 0.7; }
.inflation-option .option-title { font-weight: bold; font-size: 1.05rem; color: #fff; display: block; }
.inflation-option .option-desc { font-size: 0.85rem; color: #888; margin-top: 5px; display: block; }
.inflation-toggle-group input[type="radio"]:checked + .inflation-option { background-color: rgba(30, 144, 255, 0.15); border-color: var(--accent-blue); box-shadow: 0 0 15px rgba(30, 144, 255, 0.3); opacity: 1; transform: translateY(-2px); }
.inflation-toggle-group input[type="radio"]:checked + .inflation-option .option-title { color: var(--accent-blue); }

.hidden { display: none; }
footer { background-color: #000; text-align: center; padding: 20px; margin-top: auto; font-size: 0.9rem; color: #555; border-top: 1px solid #222; }

/* Menüpunkt "Alles geteilt durch 21M" */
.fraction-menu-item { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; vertical-align: middle; line-height: 1; color: var(--bg-color) !important; transform: translateY(2px); }
.fraction-menu-item .fraction-top { font-size: 1.3em; line-height: 0.8; margin-bottom: 2px; }
.fraction-menu-item .fraction-line { width: 100%; height: 2px; background-color: var(--bg-color); margin: 1px 0; }
.fraction-menu-item .fraction-bottom { font-size: 0.9em; font-weight: bold; line-height: 0.9; }
.header-nav-links .header-link:hover .fraction-menu-item { filter: brightness(1.2); }

.calc-btn-wrapper { display: flex; justify-content: center; margin-top: 30px; width: 100%; }
.main-calculate-btn { background: linear-gradient(135deg, var(--bg-color) 0%, #e08214 100%); color: #fff; font-size: 1.2rem; font-weight: bold; text-transform: uppercase; padding: 15px 50px; border: none; border-radius: 50px; cursor: pointer; box-shadow: 0 4px 15px rgba(247, 147, 26, 0.4); transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1); letter-spacing: 1px; width: auto; min-width: 250px; position: relative; overflow: hidden; }
.main-calculate-btn:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 25px rgba(247, 147, 26, 0.6); background: linear-gradient(135deg, #ffa02e 0%, #d47a12 100%); }
.main-calculate-btn:active { transform: translateY(1px); box-shadow: 0 2px 10px rgba(247, 147, 26, 0.4); }

@media (max-width: 1200px) { .header-title { display: none; } }
@media (max-width: 1000px) { main { flex-direction: column; padding: 10px; align-items: center; } .header-nav-links { display: none; } .header-title { display: block; position: static; transform: none; flex: 1; } #zitat-box-links, #zitat-box-rechts { display: none !important; } #hauptinhalt-wrapper { order: 1; width: 100%; min-width: 0; } .timeline-container::after { left: 31px; } .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; } .timeline-item::after { left: 21px; } .timeline-item.left, .timeline-item.right { left: 0; text-align: left; } .result-row { grid-template-columns: 1fr 1fr; row-gap: 5px; } .result-value { text-align: right; } .wealth-diagram-container { height: 400px; } }