/* ===========================================
   Trading Dashboard - Einheitliches Stylesheet
   =========================================== */

/* ===== Header & Navigation ===== */
.site-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.main-nav {
    display: flex;
    gap: 5px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    transition: background 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.3);
    font-weight: bold;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}

/* ===== Basis-Layout ===== */
body {
    font-family: sans-serif;
    padding: 0;
    background: #f4f7f9;
    margin: 0;
}

.container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin: 20px auto;
}

.container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin: auto;
}

/* ===== Grid-Layout ===== */
.grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* ===== Formular-Elemente ===== */
label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

select,
input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

select:focus,
input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 3px rgba(52, 152, 219, 0.3);
}

button {
    padding: 10px 20px;
    background: #3498DB;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

button:hover {
    background: #2980B9;
}

button:active {
    background: #2980B9;
}

/* ===== Tabellen ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: right;
    font-size: 0.7em;
}

th {
    background-color: #3498db;
    color: white;
    text-align: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

th.sortable:hover {
    background-color: #2980b9;
}

th.sorted-asc::after {
    content: " ▲";
    font-size: 0.7em;
}

th.sorted-desc::after {
    content: " ▼";
    font-size: 0.7em;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

tr:hover {
    background-color: #e1f5fe;
}

/* ===== Tabellen-Spalten ===== */
.ticker-col {
    text-align: left;
    font-weight: bold;
}

.name-col {
    text-align: left;
}

.links-col {
    text-align: center;
    white-space: nowrap;
}

/* ===== Externe Links (Y/G Buttons) ===== */
.ext-link {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    margin: 0 2px;
    cursor: pointer !important;
    transition: background 0.2s;
}

.ext-link:hover {
    background: #2980b9;
}

/* ===== Klickbare Ticker ===== */
.clickable-ticker {
    color: #3498db;
    text-decoration: underline;
    cursor: pointer;
}

.clickable-ticker:hover {
    color: #2980b9;
}

/* ===== Lade-Anzeige ===== */
.loading {
    color: #3498db;
    font-weight: bold;
    text-align: center;
    padding: 20px;
}

/* ===== Rendite-Farben ===== */
.positive {
    color: #27ae60;
    font-weight: bold;
}

.negative {
    color: #e74c3c;
    font-weight: bold;
}

/* ===== Hurst-Exponent Farben ===== */
.hurst-trend {
    background-color: #d5f5e3;
    color: #1e8449;
    font-weight: bold;
}

.hurst-reversion {
    background-color: #fadbd8;
    color: #922b21;
    font-weight: bold;
}

.hurst-random {
    background-color: #fdebd0;
    color: #9a7d0a;
}

/* ===== Beta Farben ===== */
.beta-high {
    background-color: #fadbd8;
    color: #922b21;
    font-weight: bold;
}

.beta-low {
    background-color: #d4efdf;
    color: #1e8449;
    font-weight: bold;
}

.beta-neutral {
    color: #566573;
}

/* ===== Legende ===== */
.legend {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 5px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.legend-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.legend-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #bdc3c7;
    flex-shrink: 0;
}

/* ===== Fehlermeldungen ===== */
.error {
    color: #e74c3c;
    font-weight: bold;
    padding: 10px;
    background: #fadbd8;
    border-radius: 4px;
    margin: 10px 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 900px) {
    .grid-row {
        grid-template-columns: 1fr 1fr;
    }

    .legend {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2c3e50;
        flex-direction: column;
        padding: 10px 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .main-nav.open {
        display: flex;
    }

    .nav-link {
        padding: 15px 20px;
        border-radius: 0;
    }

    .site-header {
        position: relative;
    }

    .header-container {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .grid-row {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 15px;
    }

    table {
        font-size: 0.85rem;
    }

    th,
    td {
        padding: 6px;
    }

    .site-title {
        font-size: 1.2rem;
    }
}

#zeitanalyseTable th,
#zeitanalyseTable td {
    text-align: center;
}

#zeitanalyseTable th:nth-child(1),
#zeitanalyseTable th:nth-child(2),
#zeitanalyseTable td:nth-child(1),
#zeitanalyseTable td:nth-child(2) {
    text-align: left;
}

.time-hint {
    background-color: #ffe0e0;
    border-left: 4px solid #e74c3c;
    padding: 10px 15px;
    margin-top: 10px;
    color: #c0392b;
    font-weight: bold;
}