﻿/* Anpassa offcanvas-bredd */
.offcanvas.offcanvas-end {
    width: 380px;
    max-width: 95%;
}

.offcanvas-end {
    box-shadow: -3px 0 10px rgba(0,0,0,0.2);
}

.offcanvas-toggle-btn {
    position: fixed;
    top: 4rem;
    right: 0;
    transform: none;
    z-index: 1050; /* så den ligger över allt annat */
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
/* liten statuscirkel (om du vill använda) */
/*         .status-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            display: inline-block;
            margin-right: 8px;
        } */

.clickable-row:hover {
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Swiper-container */
.swiper {
    width: 100%;
    max-height: 110px;
}

/* Swiper-slides / kort */
.swiper-slide {
    width: auto !important;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: box-shadow 0.25s ease, transform 0.2s ease, filter 0.25s ease;
}

/*.swiper-wrapper.fade-out {
    opacity: 0.3;
    transition: opacity 0.25s ease;
}

.swiper-wrapper.fade-in {
    opacity: 1;
    transition: opacity 0.25s ease;
}*/

    .swiper-slide:hover {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); /* tydligare skugga */
        transform: translateY(-4px) scale(1.03); /* liten “pop”-effekt */
        filter: brightness(1.05); /* gör den lite ljusare */
        cursor: pointer; /* indikerar klickbarhet */
    }

    /* Kortets innehåll */
    .swiper-slide .card {
        padding: 0.3rem 0.5rem; /* mindre padding */
        min-width: 160px; /* något smalare */
        font-size: 0.85rem; /* något mindre text */
    }

        /* Rubrik på kort */
        .swiper-slide .card h6 {
            margin-bottom: 0.2rem;
            line-height: 1.1; /* tätare radavstånd */
        }

        /* Tid / info */
        .swiper-slide .card p {
            margin-bottom: 0;
            line-height: 1.1; /* tätare radavstånd */
        }

        /* Ikon */
        .swiper-slide .card i {
            font-size: 1rem; /* lagom storlek */
            margin-top: 0.1rem;
        }

/* Navigation-knappar */
.swiper-button-next,
.swiper-button-prev {
    color: #ffffff;
    background-color: rgba(0,0,0,0.4);
    border-radius: 50%;
    width: 35px; /* lite mindre */
    height: 35px;
}

    .swiper-button-next:hover,
    .swiper-button-prev:hover {
        background-color: rgba(0,0,0,0.7);
    }

    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 25px; /* något mindre */
    }



#eventSidebar {
    width: 300px; /* önskad bredd */
    max-width: 80%; /* valfritt, för mobil */
}

/* Serie-fält */
.result-series {
    color: black;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

    .result-series .attempt {
        display: inline-block;
        min-width: 4rem; /* gör alla lika breda */
        text-align: center;
        border: 1px solid #ccc;
        border-radius: 4px;
        background: #f8f9fa;
        padding: 0.1rem 0.3rem;
    }

    .result-series .wind {
        font-style: italic;
        font-size: 0.8em;
    }

/* ========== HÖJD/STAV SPECIFIKT ========== */
.result-series-scroll {
    display: flex;
    overflow-x: auto;
    gap: 0.4rem;
    padding: 0.25rem 0;
    -webkit-overflow-scrolling: touch;
}

.hj-attempt {
    flex: 0 0 auto;
    text-align: center;
    min-width: 2.5rem; /* fast bredd för lika stora rutor */
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
}

.hj-height {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
}

.hj-mark {
    display: block;
    font-family: monospace;
    font-size: 0.8rem;
    color: #495057;
}

/* ========== MÅNGKAMP (CE) ========== */

.ce-series-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /*         padding-bottom: 0.4rem;
 */
}

.ce-series-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 4.5rem; /* exakt bredd per gren */
    gap: 0.3rem;
}

.ce-series-table {
    table-layout: auto;
    width: max-content;
    min-width: 80%;
    border-collapse: collapse;
}

    .ce-series-table th {
        font-size: 0.7rem;
        font-weight: 500;
        font-style: italic;
    }

    .ce-series-table th,
    .ce-series-table td {
        width: 5rem;
        min-width: 5rem;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ce-series-table .wind {
        font-size: 0.75rem;
        margin-left: 0.15rem;
    }


/* ---------- DESKTOP (bredare än 768px) ---------- */
@media (min-width: 769px) {
}

/* ================================
       ALLMÄNT / BAS
    ================================ */
.result-card {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

    .result-card.active-athlete {
        background-color: #ffe5b4;
        border-color: #ff9900;
        box-shadow: 0 0 10px rgba(255, 165, 0, 0.4);
        box-shadow: 0 0 10px rgba(255, 165, 0, 0.4);
        transition: background-color 0.3s ease, box-shadow 0.3s ease, border-left 0.3s ease;
    }

/* ---------- RAD 1: namn, resultat, placering ---------- */
.result-row-1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.result-bib {
    font-weight: 600;
    font-size: 1rem;
    min-width: 2.5rem;
    text-align: right;
    color: #555;
}

.result-name {
    font-weight: 600;
    font-size: 1rem;
    min-width: 6rem;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
}

.result-left {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.result-extra {
    display: flex;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #444;
}

.result-right {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.result-value {
    font-weight: 700;
    color: #0d6efd;
    text-align: right;
}

.result-qual,
.result-record {
    font-size: 0.85rem;
    min-width: 2rem;
}

.result-rank {
    font-weight: 700;
    text-align: right;
    min-width: 2rem;
}

/* ---------- RAD 2: bana, flagga, klubb, PB/SB ---------- */
.result-row-2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    font-size: 0.85rem;
    color: black;
    margin-top: 0.2rem;
    padding-left: 5rem;
    justify-content: flex-start;
}

.result-lane {
    font-weight: 600;
    color: #6c757d;
}

.result-nation {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.result-club {
    font-style: italic;
}

.result-pbsb {
    font-size: 0.8rem;
    font-style: italic;
}

/* ---------- NOTE ---------- */
.result-note {
    /*         flex-basis: 100%; */ /* ny rad */
    text-align: right; /* längst till höger */
    margin-left: auto;
    font-style: italic;
    color: #555;
}

/* ---------- RAD 3: serie/hoppserie ---------- */
.result-row-3 {
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

/* ================================
       MOBIL (max 768px)
    ================================ */
@media (max-width: 768px) {
    .result-row-1 {
        align-items: baseline;
    }

    .result-row-2 {
        padding-left: 0;
        justify-content: flex-start; /* fält till vänster */
    }

    .result-bib {
        font-size: 0.95rem;
    }

    .result-name {
        min-width: 0;
    }

    .result-left {
        position: absolute;
        left: 12%;
    }

    .result-right {
        gap: 0.4rem;
        align-items: center;
    }

    .result-extra {
        display: none;
    }

    .result-note {
        text-align: right;
        margin-left: auto;
    }

    .result-series .attempt {
        min-width: 4.3rem;
    }

    .d-flex.justify-content-between.align-items-center {
        padding: 0 0.75rem;
    }
}

/* ================================
       DESKTOP (min 769px)
    ================================ */
@media (min-width: 769px) {
    .result-bib {
        width: 3rem;
    }

    .result-left {
        position: absolute;
        left: 5rem;
    }

    .result-extra {
        position: absolute;
        left: 50%;
    }
    /* Dölj nation/klubb i rad 2 */
    .result-card .result-row-2 .result-nation,
    .result-card .result-row-2 .result-club {
        display: none;
    }


    #btnToggleSort.active {
        background-color: #0d6efd;
        color: white;
    }
