/* ==========================================================
   RP-CHRONIK V0.03
   style.css

   - Hell-/Dunkelmodus
   - 144er Tagesuhr
   - Ereignistabelle
   - Tooltip
   - RP-Farbklassen
========================================================== */


/* ==========================================================
   FARBSCHEMEN
========================================================== */

body.dark {

    --bg: #0f1115;
    --panel: #1a1f27;
    --panel2: #252c36;

    --text: #f2f2f2;
    --text-muted: #b7bcc3;

    --border: #353d49;

    --accent: #cc3333;
    --accent-soft: #7a1d1d;

    --hover: rgba(255,255,255,0.04);

    --shadow:
        0 8px 24px rgba(0,0,0,0.35);
}

body.light {

    --bg: #f7f7f7;
    --panel: #ffffff;
    --panel2: #ececec;

    --text: #111111;
    --text-muted: #555555;

    --border: #cfcfcf;

    --accent: #b00020;
    --accent-soft: #e6b4bc;

    --hover: rgba(0,0,0,0.03);

    --shadow:
        0 8px 24px rgba(0,0,0,0.10);
}


/* ==========================================================
   BASIS
========================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {

    margin: 0;

    background: var(--bg);

    color: var(--text);

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    transition:
        background .25s ease,
        color .25s ease;
}


/* ==========================================================
   LAYOUT
========================================================== */

.wrapper {

    max-width: 1700px;

    margin: 0 auto;

    padding: 20px;
}


/* ==========================================================
   HEADER
========================================================== */

.header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 20px;
}

.header h1 {

    margin: 0;

    font-size: 1.8rem;

    font-weight: 700;
}

.subtitle {

    margin-top: 4px;

    color: var(--text-muted);

    font-size: 0.85rem;
}


/* ==========================================================
   THEME BUTTON
========================================================== */

#themeToggle {

    width: 42px;
    height: 42px;

    border-radius: 50%;

    border: 1px solid var(--border);

    background: var(--panel);

    color: var(--text);

    cursor: pointer;

    font-size: 1.1rem;

    transition:
        transform .2s ease,
        background .2s ease;
}

#themeToggle:hover {

    transform: scale(1.05);
}


/* =====================================
   Titel + Filterzeile
===================================== */

.header-row
{
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 1rem;

    margin-bottom: 1rem;
}

.header-row h1
{
    margin: 0;
}

#eventCounter
{
    font-size: 0.75em;

    color: #888;

    font-weight: normal;
}

#searchInput
{
    width: 100%;

    padding: 4px 8px;

    font-size: 0.6rem;

    background: var(--table-bg);

    color: var(--text-color);

    border: 1px solid var(--border-color);

    border-radius: 4px;
}

#searchInput::placeholder
{
    color: #888;
}


/* ==========================================================
   KARTEN
========================================================== */

#clockCard,
.tableCard {

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 14px;

    box-shadow: var(--shadow);
}

#clockCard {

    padding: 16px;
}


/* ==========================================================
   TAGESUHR
========================================================== */

#info {

    margin-bottom: 12px;

    color: var(--text-muted);

    font-size: 0.85rem;
}


/* 72 Felder */

#top {

    display: grid;

    grid-template-columns: repeat(72, 1fr);

    gap: 2px;

    height: 20px;

    margin-bottom: 10px;
}

.cell {

    background: var(--panel2);

    transition:
        background .2s ease;
}

.cell.active {

    background: var(--accent);
}


/* Fortschrittsbalken */

#bottom {

    width: 100%;

    height: 12px;

    overflow: hidden;

    border-radius: 999px;

    background: var(--panel2);
}

#progress {

    height: 100%;

    width: 0%;

    background: var(--accent);

    transition:
        width .2s linear;
}


/* ==========================================================
   TABELLENBEREICH
========================================================== */

.tableSection {

    margin-top: 24px;
}

.tableSection h2 {

    margin-bottom: 12px;

    font-size: 1.2rem;

    font-weight: 600;
}

.tableCard {

    overflow: hidden;
}


/* ==========================================================
   TABELLE
========================================================== */

table {

    width: 100%;

    border-collapse: collapse;
}

thead {

    background: var(--panel2);
}

th {

    text-align: left;

    padding: 12px 14px;

    color: var(--text-muted);

    font-size: 0.75rem;

    text-transform: uppercase;

    letter-spacing: .05em;
}

td {

    padding: 12px 14px;

    border-top:
        1px solid rgba(128,128,128,0.15);

    vertical-align: top;
}

tbody tr:hover {

    background: var(--hover);
}


/* ==========================================================
   RP-SPALTE
========================================================== */

.distanceHeader {

    width: 180px;
}

.distance {

    width: 180px;

    text-align: right;

    white-space: nowrap;

    cursor: help;

    font-family:
        "Cascadia Mono",
        "Consolas",
        "Liberation Mono",
        monospace;

    font-variant-numeric:
        tabular-nums;

    letter-spacing: 0;
}


/* ==========================================================
   RP-FARBEN
========================================================== */

.distance.rp {

    color: var(--accent);

    font-weight: 600;
}

.distance.krp {

    color: #d17f00;

    font-weight: 600;
}

.distance.mrp {

    color: #007a34;

    font-weight: 600;
}


/* ==========================================================
   EREIGNISSPALTEN
========================================================== */

.event {

    font-size: 0.9rem;

    font-weight: 600;

    line-height: 1.4;
}

.note {

    color: var(--text-muted);

    font-size: 0.85rem;

    line-height: 1.5;
}


/* ==========================================================
   TOOLTIP
========================================================== */

#tooltip {

    position: fixed;

    display: none;

    pointer-events: none;

    z-index: 99999;

    min-width: 320px;

    max-width: 450px;

    padding: 12px 14px;

    border-radius: 10px;

    border: 1px solid var(--border);

    background: var(--panel);

    color: var(--text);

    box-shadow: var(--shadow);

    font-size: 0.8rem;

    line-height: 1.45;
}

#tooltip.visible {

    display: block;
}

.tooltip-title {

    font-weight: 700;

    margin-bottom: 8px;

    color: var(--accent);
}

.tooltip-group {

    margin-top: 8px;
}

.tooltip-label {

    font-weight: 600;

    color: var(--text-muted);
}

.tooltip-value {

    margin-left: 6px;
}


/* ==========================================================
   LINKS
========================================================== */

a {

    color: var(--accent);

    text-decoration: none;
}

a:hover {

    text-decoration: underline;
}


/* ==========================================================
   FOOTER
========================================================== */

.footer {

    margin-top: 18px;

    padding-top: 12px;

    color: var(--text-muted);

    font-size: 0.8rem;
}


/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 1000px) {

    .distanceHeader,
    .distance {

        width: 120px;
    }

    th,
    td {

        padding: 10px;
    }
}

@media (max-width: 700px) {

    .header {

        flex-direction: column;

        align-items: flex-start;

        gap: 10px;
    }

    #themeToggle {

        align-self: flex-end;
    }

    .event,
    .note {

        font-size: 0.8rem;
    }

    .distance {

        font-size: 0.75rem;
    }

    #tooltip {

        max-width: 280px;
    }
}