﻿/* SkateSweden-inspired design tokens & base styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --color-blue: #005293;
    --color-yellow: #ecd235;
    --color-blue-900: #003d6e;
    --color-blue-700: #004b85;
    --color-blue-50: #e6eff7;
    --color-yellow-50: #fbf6d3;
    --color-black: #111111;
    --color-text: #1f2937;
    --color-muted: #607387;
    --color-border: rgba(0, 82, 147, 0.12);
    --color-bg: #ffffff;
    --color-bg-alt: #f3f8fc;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 12px 30px rgba(14, 50, 86, 0.08);
    --shadow-lg: 0 20px 44px rgba(14, 50, 86, 0.14);
    --container-max: 1200px;
    --font-sans: "Sweden Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans", sans-serif;
    --h1: clamp(2rem, 1.2rem + 2.5vw, 3rem);
    --h2: clamp(1.5rem, 1.05rem + 1.8vw, 2.25rem);
    --h3: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
    --lead: 1.125rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    background: linear-gradient(180deg, #f6fbff 0%, #ffffff 28%, #f4f9fd 100%);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .5em;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--color-black);
}

h1 {
    font-size: var(--h1);
}

h2 {
    font-size: var(--h2);
}

h3 {
    font-size: var(--h3);
}

.lead {
    font-size: var(--lead);
    color: var(--color-muted);
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--color-blue);
    text-decoration: none;
    font-weight: 600;
}

a:hover, a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.button, button, [type="button"], [type="submit"] {
    --btn-bg: var(--color-blue-700);
    --btn-text: #fff;
    --btn-border: transparent;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 0.9rem 1.25rem;
    border-radius: 999px;
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-text);
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.button:hover, button:hover, [type="button"]:hover, [type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.button:focus-visible, button:focus-visible, [type="button"]:focus-visible, [type="submit"]:focus-visible {
    outline: 3px solid rgba(0, 82, 147, 0.2);
    outline-offset: 2px;
}

.convert-button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 6.25rem;
    padding: 1.4rem 1.6rem;
    border-radius: 1.6rem;
    background: linear-gradient(135deg, var(--color-blue), var(--color-blue-700));
    box-shadow: var(--shadow-md);
    font-size: 1rem;
    text-align: center;
}

.convert-button span {
    display: block;
    max-width: 20ch;
}

.convert-button:disabled,
.convert-button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.15);
}

.button--secondary {
    --btn-bg: transparent;
    --btn-text: var(--color-blue);
    --btn-border: var(--color-blue);
}

.button--accent {
    --btn-bg: var(--color-yellow);
    --btn-text: #1b1b1b;
}

.badge {
    display: inline-block;
    padding: .35rem .6rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: .8rem;
    letter-spacing: .02em;
}

.card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .06s ease;
}

    .card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-1px);
    }

.card__media img {
    width: 100%;
    height: auto;
    display: block;
}

.card__body {
    padding: 1rem;
}

.card__title {
    font-size: 1.125rem;
    font-weight: 800;
    margin-bottom: .35rem;
}

.card__meta {
    color: var(--color-muted);
    font-size: .9rem;
}

.section {
    padding: 2.5rem 1rem;
    background: var(--color-bg);
}

    .section.alt {
        background: var(--color-bg-alt);
    }

.container {
    margin: 0 auto;
    max-width: var(--container-max);
}

.page-header {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: var(--color-yellow-50);
    color: var(--color-blue);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.content-card {
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-md);
}

.content-card--soft {
    background: linear-gradient(180deg, rgba(230, 239, 247, 0.75), rgba(255, 255, 255, 0.95));
}

.button-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    align-items: stretch;
}

.grid {
    display: grid;
    gap: 1rem;
}

    .grid.cols-2 {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .grid.cols-3 {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }

    .grid.cols-4 {
        grid-template-columns: repeat(4, minmax(0,1fr));
    }

.list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.list__item {
    padding: 1rem;
    border-left: 4px solid var(--color-blue);
    background: var(--color-blue-50);
    border-radius: var(--radius-md);
}

    .list__item .date {
        font-weight: 800;
        color: var(--color-blue);
    }

    .list__item a {
        color: var(--color-black);
        font-weight: 800;
    }

        .list__item a:hover {
            color: var(--color-blue);
            text-decoration: none;
        }

input, select, textarea {
    width: 100%;
    padding: .7rem .85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: #fff;
    font: inherit;
}

    input:focus, select:focus, textarea:focus {
        outline: 3px solid color-mix(in srgb, var(--color-blue) 30%, transparent);
        border-color: var(--color-blue);
    }

.tabs {
    display: flex;
    gap: .5rem;
    border-bottom: 2px solid var(--color-border);
}

.tab-button {
    background: none;
    border: none;
    color: #6b7280;
    padding: .7rem 1.2rem;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: border-color .2s, color .2s;
}

    .tab-button:hover {
        color: #1b1b1b;
    }

    .tab-button.active {
        color: #6b7280;
    }

.tab-content {
    padding: 1rem 0;
}

@media (max-width: 1024px) {
    .grid.cols-4 {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }
}

@media (max-width: 768px) {
    .grid.cols-3, .grid.cols-4 {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .button-row {
        flex-direction: column;
        align-items: stretch;
    }

    .convert-button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .grid.cols-2, .grid.cols-3, .grid.cols-4 {
        grid-template-columns: 1fr;
    }
}

/* === Data tables =============================================================
   Shared markup pattern for the record listings (admin, deltagare, diagnostik):
   .data-table-wrap > table.data-table, with Shared/SortHeader.razor for sortable
   headers and Shared/TablePager.razor below the table. */

.data-table-wrap {
    /* Wide listings scroll inside the card instead of widening the page. */
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    background: #fff;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    vertical-align: top;
    /* Long competition names and access codes wrap instead of clipping or pushing
       the action buttons out of view. */
    overflow-wrap: anywhere;
}

.data-table thead th {
    background: var(--color-blue-50);
    border-bottom: 2px solid var(--color-border);
    color: #10263f;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.data-table tbody td {
    border-bottom: 1px solid rgba(0, 82, 147, 0.08);
    color: var(--color-text);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background: rgba(0, 82, 147, 0.035);
}

.data-table__th--actions {
    text-align: center;
}

.data-table td.data-table__cell--actions {
    text-align: center;
    white-space: nowrap;
}

.data-table__empty {
    padding: 1.25rem 0.75rem;
    text-align: center;
    color: var(--color-muted);
}

/* Sortable header button — a plain button reset, not the global pill button. */
.data-table__sort {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.data-table__sort:hover {
    transform: none;
    box-shadow: none;
    color: var(--color-blue);
}

.data-table__sort.is-active {
    color: var(--color-blue);
}

.data-table__sort-arrow {
    font-size: 0.7rem;
    opacity: 0.45;
}

.data-table__sort.is-active .data-table__sort-arrow {
    opacity: 1;
}

/* Pager */
.data-table-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.data-table-pager__status {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.data-table-pager__buttons {
    display: flex;
    gap: 0.5rem;
}

.data-table-pager__btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    background: #fff;
    color: var(--color-blue);
    border: 1px solid var(--color-blue);
    box-shadow: none;
}

.data-table-pager__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: .5rem !important;
}

.mt-2 {
    margin-top: 1rem !important;
}

.mt-3 {
    margin-top: 1.5rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: .5rem !important;
}

.mb-2 {
    margin-bottom: 1rem !important;
}

.mb-3 {
    margin-bottom: 1.5rem !important;
}


/* General messagebox container */
.message-box {
    background-color: #1e1e1e; /* dark background */
    color: #f1f1f1; /* default light text */
    font-family: Consolas, monospace;
    font-size: 14px;
    border-radius: 10px;
    padding: 5px;
}

    /* Icon styling (emoji or font-awesome) */
    .message-box .icon {
        margin-right: 8px;
        font-size: 16px;
    }

/* Color helpers for different message types */
.message-info {
    color: #4fc3f7; /* light blue */
}

.message-success {
    color: #81c784; /* soft green */
}

.message-error {
    color: #e57373; /* soft red */
}

.message-warning {
    color: #ffb74d; /* amber/orange */
}

/* Optional: Bold important text */
.message-box strong {
    color: #ffffff;
    font-weight: 600;
}
