:root {
    /* Farbschema */
    --primary-color: #003366;  /* Dunkelblau */
    --secondary-color: #0055A4; /* Blau */
    --accent-color: #f39c12;  /* Goldgelb */
    --light-color: #f4f4f9;  /* Helles Grau */
    --background-color: #F0F8FF; /* Helles Blau */
    --text-color: #333; /* Textfarbe */
    --link-color: #007BFF; /* Linkfarbe */
    --hover-bg-color: #E0E0E0;  /* Hover-Hintergrundfarbe */
    --hover-text-color: #003366;  /* Hover-Textfarbe */
    --success-color: green;  /* Erfolgsfarbe */
    --error-color: red;  /* Fehlerfarbe */
    --highlight-color: #ff7f50;  /* Hervorhebung */
    --border-color: #ddd;  /* Border-Farbe */
    --shadow-color: rgba(0, 0, 0, 0.1);  /* Schattenfarbe */
    --tab-bg-color: #003366;  /* Tab-Hintergrundfarbe */
    --tab-active-bg-color: #f39c12;  /* Aktiver Tab-Hintergrund */
    --tab-hover-color: #003366; /* Tab Hover-Farbe */
    --tab-hover-bg-color: #f39c12; /* Tab Hover-Hintergrund */
    --card-bg-color: #f9f9f9;  /* Karten-Hintergrundfarbe */
    --container-bg-color: #ffffff;  /* Container Hintergrundfarbe */
    --formula-bg-color: #eef7ff;  /* Formel-Hintergrundfarbe */
    --example-bg-color: #fff8e1;  /* Beispiel-Hintergrundfarbe */
    --info-text-color: #0055A4; /* Info Textfarbe */
    --stat-bg-color: #eef; /* Stat Hintergrundfarbe */
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-color);
    color: var(--text-color);
}

body a {
    text-decoration: none;
}

header {
    background-color: var(--primary-color);
    color: white;
    display: flex;
    text-align: center;
    align-items: center;
    padding: 10px 20px;
    flex-wrap: wrap;
}

header img {
    height: 100px;
    margin-right: 20px;
    background-color: white;
    flex-shrink: 0;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
    flex-grow: 1;
    text-align: center;
    color: white;
}

header a {
    color: white;
    text-decoration: none;
}

nav {
    background-color: var(--secondary-color);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

nav ul li {
    margin: 5px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

nav ul li a:hover {
    background-color: var(--hover-bg-color);
    color: var(--hover-text-color);
}

main {
    padding: 20px;
    background-color: var(--background-color);
}

footer {
    text-align: center;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    position: fixed;
    bottom: 0;
    width: 100%;
}

footer a{
    color: var(--link-color);
}

.container {
    width: 80%;
    margin: 10px auto;
    padding: 20px;
    background-color: var(--container-bg-color);
    border-radius: 8px;
    box-shadow: 0 0 10px var(--shadow-color);
}

.intro-text {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
}

/* TabBar für Unterseiten */
.tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background-color: var(--tab-bg-color);
    border-radius: 5px;
    padding: 10px;
}

.tab {
    color: white;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 5px;
}

.tab.active {
    color: var(--primary-color);
    background-color: var(--tab-active-bg-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab:hover{
    color: var(--tab-hover-color);
    background-color: var(--tab-hover-bg-color);
}

/* Ranglisten */
.rangliste h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2em;
}

.rangliste h2 {
    text-align: center;
}

.rangliste table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1em;
}

.rangliste th, td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.rangliste th {
    background-color: var(--primary-color);
    color: white;
}

.rangliste .highlight {
    background-color: var(--accent-color) !important;
    font-weight: bold;
}

.rangliste .table-meta {
    text-align: right;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--text-color);
}

.rangliste tr:nth-child(even) {
    background-color: #f9f9f9;
}

.rangliste tr:hover {
    background-color: #e2e2e2;
}

.rangliste .ranking {
    font-weight: bold;
    color: var(--primary-color);
}

.rangliste .won-legs {
    color: var(--success-color);
    font-weight: bold;
}

.rangliste .lost-legs {
    color: var(--error-color);
    font-weight: bold;
}

.rangliste .bonus-sum {
    color: var(--success-color);
    font-weight: bold;
}

.rangliste .total-score {
    color: var(--highlight-color);
    font-weight: bold;
    font-size: 1.1em;
    background-color: var(--background-color);
}

.rangliste a.player-link {
    text-decoration: none;
    color: var(--link-color);
    font-weight: bold;
}

.rangliste a.player-link:hover {
    text-decoration: underline;
}

.rank-diff,
.score-diff {
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 4px;
    opacity: 0.5;
    font-style: italic;
}

.rank-up .rank-diff,
.score-up .score-diff {
    color: var(--success-color);
}

.rank-down .rank-diff,
.score-down .score-diff {
    color: var(--error-color);
}

.rank-same .rank-diff,
.score-same .score-diff {
    color: #999;
}

.diff-neutral {

}

.diff-same {

}



.ranking-view-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ranking-view-toggle button {
    background-color: var(--tab-bg-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.ranking-view-toggle button:hover {
    background-color: var(--tab-hover-bg-color);
    color: var(--tab-hover-color);
}

.ranking-view-toggle button.active {
    background-color: var(--tab-active-bg-color);
    color: var(--primary-color);
}

.ranking.standard .hide,
.ranking.kompakt .hide {
    display: none;
}

.kompakt .hideKompakt {
    display: none;
}


/* Styles für Info - Formeln und Beispiele */
.info h1, h2 {
    color: var(--secondary-color);
}
.info .formula {
    background-color: var(--formula-bg-color);
    border-left: 4px solid var(--secondary-color);
    padding: 10px;
    margin: 10px 0;
    font-family: 'Courier New', Courier, monospace;
}
.info .example {
    background-color: var(--example-bg-color);
    border-left: 4px solid #ffa000;
    padding: 10px;
    margin: 10px 0;
}
.info ul {
    margin: 10px 0;
    padding-left: 20px;
}
.info li {
    margin-bottom: 5px;
}
.info code {
    background-color: #eef;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}
.info strong {
    color: var(--secondary-color);
}

/* Statistiken */
.highlights table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.highlights th, .highlights td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

.highlights th {
    background-color: var(--primary-color);
    color: white;
}

.container-common {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: #f9f9f9;
}

.container-common h4 {
    margin: 0 0 10px;
    color: var(--primary-color);
}

/* Spielerübersicht */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.player-grid .player-item {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.player-grid .player-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px var(--shadow-color);
    background-color: #e6f2ff;
}

.player-grid .player-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.2em;
    font-weight: bold;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    padding: 15px;
    box-sizing: border-box;
}

/* Spielerstatistik */
.stats-section {
    background-color: var(--container-bg-color);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.stats-section h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.stats-list {
    list-style: none;
    padding: 0;
}

.stats-list li {
    font-size: 1.1rem;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.stats-list li strong {
    color: var(--primary-color);
}

.head-to-head-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.head-to-head-table th, .head-to-head-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: center;
}

.head-to-head-table th {
    background-color: var(--accent-color);
    color: white;
}

.head-to-head-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table.head-to-head-table.doppel td:nth-child(1) {
    background-color: #e6f7ff; /* Partner */
}

table.head-to-head-table.doppel td:nth-child(2),
table.head-to-head-table.doppel td:nth-child(3) {
    background-color: #fff2e6; /* Gegner */
}


.player-statistics-header {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 5px;
}

.stats-category-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.stats-category {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--shadow-color);
    padding: 15px;
}

.stats-category-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 5px;
}

.stats-list {
    list-style: none;
    padding: 0;
}

.stats-list-item {
    font-size: 1.1rem;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.stat-value {
    font-weight: bold;
    color: var(--primary-color);
}

.stat-date {
    font-style: italic;
    color: #888;
}

.no-stat-message {
    color: #888;
    font-style: italic;
    margin-top: 10px;
}

@media (max-width: 768px) {

    .container {
        width: 100%;
        margin: 5px auto;
        padding: 5px;
    }

    footer{
        position: initial;
    }

    header h1 {
        font-size: 1.2em;
        text-align: center;
        padding: 20px;
    }

    header img {
        margin: 10px 0;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 5px 0;
    }

    nav ul li a {
        padding: 8px 10px;
        text-align: center;
        width: 100%;
    }

    /* TabBar für Unterseiten */
    .tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .tab {
        margin-bottom: 10px;
        text-align: center;
        padding: 10px 0;
    }

    /* Ranglisten */
    .rangliste table, th, td {
        font-size: 0.9em;
    }

    .rangliste th, td {
        padding: 8px;
    }

    .rangliste .total-score {
        font-size: 1.2em;
    }

    .rank-diff,
    .score-diff {
        font-size: 0.6em;
    }

    /* Spielerstatistik */
    .head-to-head-table th {
        position: relative;
        padding: 10px 5px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    /* Ranglisten */
    .rangliste table {
        font-size: 0.8em;
    }

    .rangliste th, td {
        padding: 4px;
    }

    .rangliste .ranking {
        font-size: 1.1em;
    }

    .rangliste .lost-legs, .won-legs, .total-score {
        font-size: 1em;
    }
}