/* ========== KickDash Basis Theme ========== */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;600;800&display=swap');

:root {
    --kd-primary: #0ea5e9;
    --kd-on-primary: #000233;
    --kd-fg: #0b1220;
    --kd-fg-2: #314159;
    --kd-bg: #f8fafc;
    --kd-card: #ffffff;
    --kd-hero-bg: linear-gradient(135deg, #e0f2fe 0%, #f8fafc 100%);
    /* Optional: Sekundärfarbe aktivieren
    --kd-secondary: #145a86;
    */
}

body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--kd-bg);
    color: var(--kd-fg);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2.5rem;
    color: var(--kd-primary);
}

h2 {
    font-size: 1.75rem;
    color: var(--kd-fg);
}

h1:focus {
    outline: none;
}

body.using-keyboard h1:focus {
    outline: revert;
}

@media (prefers-color-scheme: dark) {
    :root {
        --kd-fg: #e6edf3;
        --kd-fg-2: #9fb0c3;
        --kd-bg: #0b1220;
        --kd-card: #0f172a;
        --kd-on-primary: #ffffff;
        --kd-hero-bg: linear-gradient(135deg, #1e293b 0%, #0b1220 100%);
    }
}

/* Hero (volle Höhe Variante) */
.kd-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: var(--kd-bg);
    overflow: hidden;
}

.kd-hero__bg {
    position: absolute;
    inset: -10% -10% auto -10%;
    height: 110%;
    background: radial-gradient(60rem 60rem at 10% -10%, rgba(14,165,233,.25), transparent 60%), radial-gradient(40rem 40rem at 110% 30%, rgba(59,130,246,.20), transparent 60%), radial-gradient(24rem 24rem at 70% 120%, rgba(236,72,153,.18), transparent 60%);
    z-index: -2;
}

.kd-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,0));
    opacity: .18;
    z-index: -1;
    pointer-events: none;
}

.kd-hero__content {
    width: min(100%, 1040px);
    padding: clamp(24px, 4vw, 64px) 24px;
    text-align: center;
    color: var(--kd-fg);
}

/* Klassischer Hero */
.kd-hero-classic {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
    max-width: 900px;
    margin: 48px auto 32px;
    border-radius: 32px;
    background: var(--kd-hero-bg);
    box-shadow: 0 8px 32px rgba(14,165,233,.12);
    overflow: hidden;
}

    .kd-hero-classic .kd-hero__bg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(30rem 30rem at 10% -10%, rgba(14,165,233,.35), transparent 60%), radial-gradient(20rem 20rem at 110% 30%, rgba(59,130,246,.25), transparent 60%), radial-gradient(12rem 12rem at 70% 120%, rgba(236,72,153,.22), transparent 60%);
        z-index: -2;
    }

    .kd-hero-classic .kd-hero__overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0,0,0,.08), rgba(0,0,0,0));
        opacity: .08;
        z-index: -1;
        pointer-events: none;
    }

    .kd-hero-classic .kd-hero__content {
        position: relative;
        width: 100%;
        max-width: 700px;
        padding: 40px 24px;
        text-align: center;
        color: var(--kd-fg);
    }

/* Typo & Titles */
.kd-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    margin: 0 0 .6rem;
    letter-spacing: .2px;
}

    .kd-title span {
        color: var(--kd-on-primary);
        text-shadow: 0 1px 0 rgba(255,255,255,.15);
    }

.kd-title--matches {
    font-size: 2rem;
    font-weight: 800;
    color: var(--kd-primary);
    margin-bottom: 1.2rem;
    letter-spacing: .5px;
    text-shadow: 0 2px 12px rgba(14,165,233,.10);
    display: inline-block;
}

    .kd-title--matches span {
        background: linear-gradient(90deg, var(--kd-primary) 60%, var(--kd-bg) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

.kd-sub {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    color: var(--kd-fg-2);
    margin: 0 auto 1.4rem;
    max-width: 52rem;
}

/* CTA / Buttons */
.kd-cta {
    display: flex;
    gap: .8rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.2rem 0 1.4rem;
}

.kd-btn {
    --padY: .85rem;
    --padX: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: var(--padY) var(--padX);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
    transition: .2s ease;
}

.kd-btn--primary {
    background: var(--kd-primary);
    color: var(--kd-on-primary);
    box-shadow: 0 6px 18px rgba(14,165,233,.35);
}

    .kd-btn--primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 26px rgba(14,165,233,.45);
    }

.kd-btn--ghost {
    background: transparent;
    color: var(--kd-fg);
    border: 1px solid color-mix(in srgb, var(--kd-fg-2) 35%, transparent);
}

    .kd-btn--ghost:hover {
        background: rgba(255,255,255,.06);
    }

.kd-select {
    appearance: none;
    padding: .85rem 1.1rem;
    font-size: 1rem;
    border-radius: 999px;
    border: 1px solid rgba(124,139,161,.18);
    background: var(--kd-card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='gray'><path d='M1.5 5.5l6.5 6 6.5-6'/></svg>") no-repeat right .8rem center;
    background-size: 1rem;
    font-family: 'Rubik', sans-serif;
    color: var(--kd-fg);
    cursor: pointer;
    min-width: 220px;
}

    .kd-select:focus {
        outline: none;
        border-color: var(--kd-primary);
        box-shadow: 0 0 0 3px rgba(14,165,233,.25);
    }

/* Highlights */
.kd-highlights {
    display: flex;
    gap: .8rem 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem auto 1.2rem;
    padding: 0;
    list-style: none;
    max-width: 60rem;
}

    .kd-highlights li {
        background: var(--kd-card);
        color: var(--kd-fg);
        border: 1px solid rgba(124,139,161,.18);
        padding: .55rem .8rem;
        border-radius: 999px;
        font-size: .95rem;
        white-space: nowrap;
        backdrop-filter: saturate(1.3) blur(2px);
    }

.kd-powered {
    margin-top: .6rem;
    font-size: .9rem;
    color: var(--kd-fg-2);
    opacity: .9;
}

/* Error UI */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Match Tiles */
.league-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}

.league-tile {
    background: #f8f9fa;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 1.5rem;
    min-width: 320px;
    flex: 1 1 320px;
}

    .league-tile h3 {
        margin: 0 0 1rem;
        color: #2c3e50;
    }

.match-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.match-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

    .match-item:last-child {
        border-bottom: none;
    }

.team {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.team-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ddd;
}

.vs {
    font-weight: bold;
    color: #888;
}

.match-date {
    margin-left: auto;
    font-size: .95em;
    color: #666;
}

.match-past {
    background: #f0f0f0;
    color: #888;
    opacity: .7;
}

.match-future {
    background: #e6ffe6;
    color: #222;
    font-weight: 500;
}

.result {
    font-weight: bold;
    color: var(--kd-primary);
    margin: 0 .5rem;
    white-space: nowrap;
}

/* Table Position Widgets */
.kd-title--tablepos {
    font-size: 1.5rem;
    color: var(--kd-primary);
    margin-bottom: 1rem;
    text-align: left;
}

.kd-card--tablepos {
    background: var(--kd-card);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(14,165,233,.10);
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 340px;
    margin: 0 auto 2rem;
}

.tablepos-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .7rem;
}

.tablepos-pos {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--kd-primary);
    margin-bottom: .2rem;
    text-shadow: 0 2px 12px rgba(14,165,233,.10);
}

.tablepos-pos-big {
    font-size: 4rem;
    font-weight: 600;
    color: var(--kd-primary);
    text-align: center;
    line-height: 1;
    margin: .5rem 0;
    text-shadow: 0 4px 24px rgba(14,165,233,.12);
}

/* Update Animation */
@keyframes matchFlash {
    0% {
        background-color: rgba(14,165,233,.10);
        box-shadow: 0 0 0 0 rgba(14,165,233,.4);
    }

    35% {
        background-color: rgba(14,165,233,.35);
        box-shadow: 0 0 12px 2px rgba(14,165,233,.35);
    }

    100% {
        background-color: transparent;
        box-shadow: 0 0 0 0 transparent;
    }
}

.match-item.match-updated {
    animation: matchFlash 1.9s ease-out;
    position: relative;
    transition: background-color .4s;
}

    .match-item.match-updated::after {
        content: "";
        position: absolute;
        inset: 0;
        border: 2px solid rgba(14,165,233,.45);
        border-radius: 8px;
        opacity: 0;
        animation: matchPulseBorder 1.6s ease-out;
        pointer-events: none;
    }

@keyframes matchPulseBorder {
    0% {
        opacity: 0;
        transform: scale(.96);
    }

    25% {
        opacity: .9;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.04);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .kd-title--matches {
        font-size: 1.3rem;
        margin-bottom: .8rem;
    }

    .league-tiles {
        display: block;
        margin: 0;
    }

    .league-tile {
        margin-bottom: 1.2rem;
        padding: .5rem;
        border-radius: 16px;
        box-shadow: 0 2px 8px rgba(14,165,233,.08);
    }

    .match-item {
        flex-direction: column;
        align-items: flex-start;
        gap: .3rem;
        font-size: .95rem;
        padding: .6rem .2rem;
    }

    .team-icon {
        width: 32px;
        height: 32px;
    }
}
