/* ==================== CSS VARIABLES ==================== */
:root {
    --bitcoin-orange: #F7931A;
    --bitcoin-orange-light: #FFB84D;
    --dark-gray: #1a1a1a;
    --medium-gray: #4a4a4a;
    --light-gray: #f5f5f5;
    --border-gray: #e0e0e0;
    --white: #ffffff;
    --signal-blue: #3b82f6;
    --signal-green: #22c55e;
    --signal-yellow: #eab308;
    --signal-orange: #f97316;
    --signal-red: #dc2626;
    --font-heading: 'Merriweather', Georgia, serif;
    --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); line-height: 1.6; color: var(--dark-gray); background-color: var(--white); -webkit-font-smoothing: antialiased; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }

/* HEADER */
header { background-color: var(--white); border-bottom: 1px solid var(--border-gray); padding: 1.5rem 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
header .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
h1 { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 900; color: var(--dark-gray); }
h1 .highlight { color: var(--bitcoin-orange); }
.logo-link { color: var(--dark-gray); text-decoration: none; transition: opacity 0.2s ease; }
.logo-link:hover { opacity: 0.8; }
nav { display: flex; gap: 2rem; }
nav a { color: var(--medium-gray); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: color 0.2s ease; position: relative; }
nav a:hover { color: var(--bitcoin-orange); }
nav a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background-color: var(--bitcoin-orange); transition: width 0.2s ease; }
nav a:hover::after { width: 100%; }

/* MAIN */
main { padding: 3rem 0; }
h2, h3, h4 { font-family: var(--font-heading); }
.intro { text-align: center; margin-bottom: 3rem; max-width: 800px; }
.intro h2 { font-size: 2rem; margin-bottom: 1rem; color: var(--dark-gray); font-weight: 700; }
.intro p { font-size: 1.1rem; color: var(--medium-gray); max-width: 650px; margin: 0 auto; }

/* DASHBOARD */
.dashboard { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; }
.chart-section { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border-gray); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-gray); }
.controls h3 { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--medium-gray); text-transform: uppercase; letter-spacing: 0.5px; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; cursor: pointer; font-size: 0.9rem; color: var(--dark-gray); transition: color 0.2s ease; }
.checkbox-label:hover { color: var(--bitcoin-orange); }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--bitcoin-orange); }
.time-range { display: flex; flex-direction: column; gap: 0.25rem; }
.time-range label { font-size: 0.85rem; color: var(--medium-gray); }
.time-range select, .currency-toggle select { padding: 0.5rem; border: 1px solid var(--border-gray); border-radius: var(--radius-sm); font-size: 0.9rem; font-family: var(--font-body); background: var(--white); cursor: pointer; transition: border-color 0.2s ease; }
.time-range select:hover, .currency-toggle select:hover { border-color: var(--bitcoin-orange); }
.currency-toggle { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.currency-toggle label { font-size: 0.85rem; color: var(--medium-gray); }
.chart-container { position: relative; height: 500px; background: var(--white); }

/* LOADING */
.loading { display: none; text-align: center; padding: 3rem; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.95); border-radius: var(--radius-lg); z-index: 10; }
.loading.active { display: block; }
.spinner { width: 48px; height: 48px; margin: 0 auto 1rem; border: 4px solid var(--light-gray); border-top-color: var(--bitcoin-orange); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading .error-icon { font-size: 3rem; margin-bottom: 1rem; }
.loading button { margin-top: 1rem; padding: 0.5rem 1.5rem; background: var(--bitcoin-orange); color: var(--white); border: none; border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-body); font-weight: 500; }

/* SIGNAL PANEL */
.signal-panel { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border-gray); padding: 1rem; display: flex; flex-direction: column; gap: 1rem; height: fit-content; position: sticky; top: 100px; box-shadow: var(--shadow-sm); }
.signal-panel h3 { font-size: 0.95rem; font-weight: 600; color: var(--dark-gray); }
.current-price { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem; background: var(--light-gray); border-radius: var(--radius-md); }
.current-price .label { font-size: 0.7rem; color: var(--medium-gray); text-transform: uppercase; letter-spacing: 0.5px; }
.current-price .price { font-size: 1.5rem; font-weight: 700; color: var(--dark-gray); }
.current-price .timestamp { font-size: 0.7rem; color: var(--medium-gray); font-style: italic; }
.traffic-light { padding: 1.5rem; background: var(--light-gray); border-radius: var(--radius-md); text-align: center; }
.light-indicator { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.light { width: 70px; height: 70px; border-radius: 50%; background: var(--border-gray); box-shadow: inset 0 0 10px rgba(0,0,0,0.1); transition: all 0.3s ease; }
.light[data-color="blue"] { background: var(--signal-blue); box-shadow: 0 0 25px rgba(59, 130, 246, 0.5); }
.light[data-color="green"] { background: var(--signal-green); box-shadow: 0 0 25px rgba(34, 197, 94, 0.5); }
.light[data-color="yellow"] { background: var(--signal-yellow); box-shadow: 0 0 25px rgba(234, 179, 8, 0.5); }
.light[data-color="orange"] { background: var(--signal-orange); box-shadow: 0 0 25px rgba(249, 115, 22, 0.5); }
.light[data-color="red"] { background: var(--signal-red); box-shadow: 0 0 25px rgba(220, 38, 38, 0.5); }
.signal-text { font-size: 1.1rem; font-weight: 700; color: var(--dark-gray); letter-spacing: 0.5px; }

/* MODEL SIGNALS */
.model-signals { display: flex; flex-direction: column; gap: 0.5rem; }
.model-signal { padding: 1rem; border-radius: var(--radius-md); border-left: 4px solid var(--border-gray); background: var(--light-gray); }
.model-signal.strong-buy, .model-signal.buy { background: rgba(34, 197, 94, 0.1); border-left-color: var(--signal-green); }
.model-signal.hold { background: rgba(234, 179, 8, 0.1); border-left-color: var(--signal-yellow); }
.model-signal.caution { background: rgba(249, 115, 22, 0.1); border-left-color: var(--signal-orange); }
.model-signal.sell { background: rgba(220, 38, 38, 0.1); border-left-color: var(--signal-red); }
.model-signal h4 { font-size: 0.85rem; margin-bottom: 0.25rem; color: var(--dark-gray); }
.model-signal .signal-status { font-size: 0.9rem; font-weight: 600; }
.model-signal .signal-detail { font-size: 0.8rem; color: var(--medium-gray); margin-top: 0.25rem; }
.disclaimer-box { padding: 1rem; background: #fef3c7; border: 1px solid #fcd34d; border-radius: var(--radius-md); font-size: 0.75rem; line-height: 1.5; }
.disclaimer-box strong { color: var(--dark-gray); }

/* SEO CONTENT */
.seo-content { margin-top: 3rem; padding-top: 3rem; border-top: 1px solid var(--border-gray); }
.seo-content h2 { font-size: 1.75rem; margin-bottom: 2rem; color: var(--dark-gray); text-align: center; }
.model-info { background: var(--light-gray); border-radius: var(--radius-lg); padding: 2rem; margin-bottom: 1.5rem; }
.model-info h3 { font-size: 1.25rem; color: var(--dark-gray); margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--bitcoin-orange); display: inline-block; }
.model-info p { color: var(--medium-gray); margin-bottom: 1rem; line-height: 1.7; }
.model-info ul { margin: 1rem 0 1rem 2rem; color: var(--medium-gray); }
.model-info li { margin-bottom: 0.5rem; line-height: 1.6; }
.model-info code { background: var(--white); padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); font-family: 'Monaco', 'Consolas', monospace; font-size: 0.9em; color: var(--bitcoin-orange); }

/* FOOTER */
footer { background: var(--dark-gray); color: var(--white); padding: 2rem 0; margin-top: 3rem; }
footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
footer p { font-size: 0.9rem; opacity: 0.8; }
footer nav { gap: 1.5rem; }
footer nav a { color: var(--white); opacity: 0.7; font-size: 0.9rem; }
footer nav a:hover { opacity: 1; color: var(--bitcoin-orange); }
footer nav a::after { background-color: var(--white); }

/* RESPONSIVE */
@media (max-width: 1200px) { .dashboard { grid-template-columns: 1fr 280px; } }
@media (max-width: 1024px) {
    .dashboard { grid-template-columns: 1fr; }
    
    /* Chart-Bereich zuerst, dann Signal-Panel */
    .chart-section { order: 1; }
    .signal-panel { 
        order: 2; 
        position: static; 
        flex-direction: row; 
        flex-wrap: wrap; 
        justify-content: space-between; 
    }
    .signal-panel > * { flex: 1 1 auto; min-width: 200px; }
    .model-signals { flex-direction: row; flex-wrap: wrap; }
    .model-signal { flex: 1 1 calc(33% - 0.5rem); min-width: 180px; }
    .controls { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .chart-container { height: 400px; }
    .intro { max-width: 100%; display: none; } /* Intro auf Mobile ausblenden für schnelleren Chart-Zugang */
}
@media (max-width: 768px) {
    header .container { flex-direction: column; align-items: flex-start; }
    nav { flex-wrap: wrap; gap: 1rem; }
    .intro { display: none; } /* Intro komplett ausblenden */
    .controls { grid-template-columns: 1fr; gap: 1rem; }
    .chart-container { height: 350px; }
    .chart-section { padding: 1rem; }
    .signal-panel { flex-direction: column; }
    .model-signals { flex-direction: column; }
    .model-signal { flex: 1 1 100%; }
    footer .container { flex-direction: column; text-align: center; }
    .seo-content h2 { font-size: 1.5rem; }
    .model-info { padding: 1.5rem; }
    .model-info h3 { font-size: 1.1rem; }
    
    /* Legende kompakter */
    .chart-section canvas { margin-bottom: 0.5rem; }
}
@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    .chart-container { height: 300px; }
    nav { font-size: 0.85rem; gap: 0.75rem; }
    .chart-section { padding: 0.5rem; }
    .current-price .price { font-size: 1.25rem; }
    .light { width: 60px; height: 60px; }
    .signal-text { font-size: 1rem; }
    .controls h3 { font-size: 0.75rem; }
    .checkbox-label { font-size: 0.85rem; }
    
    /* Noch kompaktere Legende */
    .signal-panel { padding: 0.75rem; gap: 0.75rem; }
    .current-price { padding: 0.75rem; }
    .traffic-light { padding: 1rem; }
    .disclaimer-box { font-size: 0.7rem; padding: 0.75rem; }
}

/* ANIMATIONS */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.light[data-color]:not([data-color="neutral"]) { animation: pulse 2s ease-in-out infinite; }

/* ACCESSIBILITY */
:focus-visible { outline: 2px solid var(--bitcoin-orange); outline-offset: 2px; }

/* PRINT */
@media print {
    header, footer, .signal-panel, .controls, .seo-content { display: none; }
    .dashboard { grid-template-columns: 1fr; }
    .chart-container { height: 600px; }
}
