﻿

 /*The switch - the box around the slider */
.switch {
    font-size: 17px;
    position: relative;
    display: inline-block;
    width: 3.5em;
    height: 2em;
}

     /*Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

 /*The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgb(182, 182, 182);
    transition: .4s;
    border-radius: 10px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 1.4em;
    width: 1.4em;
    border-radius: 8px;
    left: 0.3em;
    bottom: 0.3em;
    transform: rotate(270deg);
    background-color: rgb(255, 255, 255);
    transition: .4s;
}

.switch input:checked + .slider {
    background-color: #21cc4c;
}

.switch input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

.switch input:checked + .slider:before {
    transform: translateX(1.5em);
}








/*Text truncation fix*/
.table {
    table-layout: fixed;
}



td img {
    height: 100%;
    object-fit: scale-down;
    margin: 0;
    padding: 0;
}



table {
    border-collapse: collapse;
}



table.scores {
    border-collapse: separate;
    border-spacing: 1px; /* controls transparent gaps */
    background: transparent;
}

.scores td, .scores th {
    border-width:2px;
    border-radius: 0px;
    align-items: center;
    justify-content: center;
    padding: 0px 0px;
    text-align:center;
}


.border-helmet-red {
    border-color: var(--bs-red) !important;
}

.border-helmet-blue {
    border-color: var(--bs-blue) !important;
}

.border-helmet-white {
    border-color: #e6dbb9 !important;
}

.border-helmet-green {
    border-color: var(--bs-green) !important;
}

.border-helmet-yellow {
    border-color: var(--bs-yellow) !important;
}



.scores .text-start,
.scores .text-end {
    padding: 0px 8px 0px 8px
}

.border-left {
    border-top-color: #404143 !important;
    border-bottom-color: #404143 !important;
    border-right-color: #404143 !important;
    border-left-width: 25px !important;
}


.score  {
    font-size: min(3vw, 28px);
}

.guest {
    background-color: #60606099 !important;
}




body {
    background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('../Content/images/background3.jpg');
    background-attachment: fixed;
    background-position: center;
    color: #bebebe;
}


.navbar {
    margin-bottom: 20px;
}

.card .table {
    margin-bottom:0px;
}


.card-header::after {
    content: "";
    position: absolute;
    left: 0; /* or center it, see below */
    width: 75%;
    border-bottom: 2px solid var(--bs-primary);
}



.table th.rotate {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    overflow: visible;
    vertical-align: baseline;
}


.table-sm-width > :not(caption) > * > * {
    padding: 0.25rem;
}





.navbar .dropdown-menu a:hover {
    color: var(--bs-dark) !important;
}

.shadow-img {
    position: relative; /* needed for pseudo-element positioning */
}

.shadow-img::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: inherit;
    background-repeat: no-repeat;
    background-size: auto 150%;
    background-position-y: center;
    filter: drop-shadow(0 0 1px rgba(255,255,255,1)) drop-shadow(0 0 4px rgba(255,255,255,0.8));
    pointer-events: none;
    z-index: 1;
}

.crop-middle {
    height: 200px; /* desired div height */
    overflow: hidden; /* hide the parts outside */
}

.crop-middle img {
    width: 300%;
    height: 100%; /* scale so middle third fills container */
    object-fit: cover; /* keep aspect ratio */
    object-position: center; /* center the middle third */
}



.crop {
    height: 200px;
    overflow: hidden;
    position: relative;
    background-color:whitesmoke;
}

    .crop img {
        width: 300px;
        height: 300px;
        position: absolute;
        top: -20%;
        left: 10%;
        transform: translate(-50%, -50%) rotate(10deg);
        transform-origin: center;
        filter: drop-shadow(5px 5px 0px rgba(0, 0, 0, 1)) drop-shadow(0px 0px 2px rgba(255, 255, 255, 1));
    }

.crop::after {
    content: "";
    position: absolute;
    bottom:0;
    right: 0;
    width: 75%;
    border-bottom: 1px solid var(--bs-primary);
}

.crop::before {
    content: "";
    position: absolute;
    width: 75%;
    border-bottom: 1px solid var(--bs-primary);
    z-index:2;
}




.table-sort thead th.sortable {
    cursor: pointer;
    background-position: right;
    background-repeat: no-repeat;
    padding-right: 30px;
}

.table-sort thead th.both {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpolygon points='8,3 4,7 12,7' fill='%23999999'/%3E%3Cpolygon points='4,9 12,9 8,13' fill='%23999999'/%3E%3C/svg%3E");
}

.table-sort thead th.asc {
    /*background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==');*/
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpolygon points='8,3 4,7 12,7' fill='%23999999' fill-opacity='0.2'/%3E%3Cpolygon points='4,9 12,9 8,13' fill='%23ce9233'/%3E%3C/svg%3E");
}

.table-sort thead th.desc {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpolygon points='8,3 4,7 12,7' fill='%23ce9233'/%3E%3Cpolygon points='4,9 12,9 8,13' fill='%23999999' fill-opacity='0.2'/%3E%3C/svg%3E");
}




.table-dark a:hover,
.navbar a:hover {
    color: var(--bs-light) !important;
    text-decoration: underline;
}


nav-link:has(.dropdown-item:hover) {
    color: red !important;
    text-decoration: underline;
}


.dropend:has(.dropdown-menu:hover) {
    background-color: #bdbdbd;
}


.tooltip1 {
    position: relative;
    /*display: inline-block;
    border-bottom: 1px dotted black;
    cursor: pointer;*/
    
}

.tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #52504e;
    color: #ffffff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 100%;
    left: 50%;
    margin-left: -60px;
    border: 1px solid #FFF;
}

.tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #FFF transparent transparent transparent;
}

.tooltip1:hover .tooltiptext {
    visibility: visible;
}




@keyframes spinOut {
    0% {
        transform: scale(0) rotate(-360deg);
        opacity: 0;
    }


    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.spin-out {
    animation: spinOut 1s ease-out forwards;
}



.bs5-select {
    position: relative;
    width: 100%;
}

    .bs5-select .dropdown-toggle {
        width: 100%;
        text-align: left;
    }

    .bs5-select .dropdown-menu {
        width: 100%;
        max-height: 320px;
        overflow: hidden;
        padding: 0;
    }

    .bs5-select .search-box {
        padding: 0.5rem;
        border-bottom: 1px solid #dee2e6;
    }

        .bs5-select .search-box input {
            width: 100%;
        }

    .bs5-select .options-container {
        max-height: 250px;
        overflow-y: auto;
    }

    .bs5-select .dropdown-item.active {
        background-color: #0d6efd;
        color: white;
    }







.card {
    border: 1px solid #2d2d2d;
    border-radius: 5px;
    -webkit-box-shadow: 0px 0px 8px -2px var(--bs-primary);
    box-shadow: 0px 0px 8px -2px var(--bs-primary);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 1px;
    background: linear-gradient( 90deg, transparent, var(--bs-primary), transparent );
    animation: light-sweep 2s ease-in-out infinite;
}

@keyframes light-sweep {
    to {
        left: 100%;
    }
}








.match-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient( to bottom, rgba(10,15,30,0.95) 0%, rgba(10,15,30,0.9) 60%, rgba(10,15,30,0.8) 100% );
}

/* Stadium layer with blur and fade */
.match-card .card-body::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background-image: var(--track);
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    z-index: 0;
    /* Make it blend into background */
    filter: brightness(0.3);
    mask-image: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0));
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0));
}




.match-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image: var(--team1), var(--team2), var(--team3), var(--team4);
    background-repeat: no-repeat, no-repeat;
    background-position: left -25px top -25px, right -25px top -25px, left -25px bottom -25px, right -25px bottom -25px;
    background-size: auto 80%, auto 80%;
    opacity: 0.8;
    mask-image: radial-gradient(circle,rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 37%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: radial-gradient(circle,rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 37%, rgba(0, 0, 0, 0) 100%);
}




/* Keep content above everything */

.match-card .card-body  {
    text-shadow: 0px 0px 4px black,0px 0px 3px black,0px 0px 2px black,0px 0px 1px black,0px 0px 5px black;
}

.match-card .card-body * {
    position: relative;
    z-index: 3;
    text-shadow: 0px 0px 15px rgba(10,15,30), 0px 0px 15px rgba(10,15,30), 0px 0px 15px rgba(10,15,30), 0px 0px 15px rgba(10,15,30), 0px 0px 15px rgba(10,15,30), 0px 0px 15px rgba(10,15,30);
}


/*Track*/
.card1::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,rgba(0, 0, 0, 1) 6%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 1) 95%), url('https://www.speedwaystar.net/images/newspost_images/lakeside_stadium_0193_ge.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% auto;
    min-height:500px;
    filter: blur(5px);
    z-index: -1;
}




.chart {
    width: 100%;
    height: 100%;
    padding: 10px 20px 40px 60px;
    position: relative;
}


.gate-stats::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #2b2c2e99;
    z-index: -1;
}


.gate-stats {
    --chart-red: #ff6e6e;
    --chart-blue: #7c7cfb;
    --chart-white: white;
    --chart-yellow: #ffed8a;
}


.chart > * {
    position: relative;
    z-index: 1;
}

/* Y axis label */
.y-axis {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: rotate(-90deg) translateX(-50%);
    transform-origin: left center;
    font-weight: bold;
}


/* Bars container */
.bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between; /* distribute bars evenly */
    height: 100%;
    gap: 2%; /* optional spacing between bars */
}

/* Bar group */
.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    flex: 1; /* each group takes equal width */
    height:100%;
}

/* Bar itself */
.bar {
    width: 70%; /* bar fills 70% of its group */
    height: calc(var(--value) * 1%);
    max-height: 100%;
    position: relative;
    transform-origin: bottom;
    transform: scaleY(0);
    animation: growBar 1s ease-out forwards, pulseDark 3s ease-in-out infinite;
    
}


@keyframes pulseDark {
    0% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(0.8);
    }

    100% {
        filter: brightness(1);
    }
}



.x-label {
    position: absolute;
    bottom: -25px; /* places label below chart area */
    font-weight: bold;
}


@keyframes growBar {
    to {
        transform: scaleY(1);
    }
}

.x-axis {
    margin-top: 15px
}

.bar-group:nth-child(1) .bar {
    animation-delay: 0.1s;
}

.bar-group:nth-child(2) .bar {
    animation-delay: 0.2s;
}

.bar-group:nth-child(3) .bar {
    animation-delay: 0.3s;
}

.bar-group:nth-child(4) .bar {
    animation-delay: 0.4s;
}

    /* Value label */
.bar::after {
    content: attr(data-value);
    position: absolute;
    top: -22px; /* Places it above the bar */
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}

.bar[data-value="0"]::after {
    display: none;
}


/* Colours */
.red {
    background: var(--chart-red);
}

.blue {
    background: var(--chart-blue);
}

.white {
    background: var(--chart-white);
}

.yellow {
    background: var(--chart-yellow);
}



.y-zero-line {
    position: absolute;
    top: 10px; /* Matches top padding */
    bottom: 40px; /* Matches bottom padding */
    left: 60px; /* Matches left padding */
    width: 1px;
    background: #e5e5e5; /* Same very light grey */
    z-index: 1;
}


.y-labels {
    position: absolute;
    top: 10px; /* Matches chart padding-top */
    bottom: 40px; /* Matches padding-bottom */
    left: 0;
    width: 60px; /* Matches left padding */
}

.y-labels span {
    position: absolute;
    bottom: var(--pos);
    left: 30px;
    transform: translateY(50%);
    font-size: 12px;
 }

.y-labels span::after {
    content: "";
    position: absolute;
    left: 30px;
    right: -1520px; /* Adjust based on chart width */
    height: 1px;
    background: #e5e5e560;
    top: 50%;
}




.pie-chart {
    margin-bottom: 0.5rem;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 70px;
    border-radius: 50%;
    position: relative;
    --total: calc(var(--v1) + var(--v2) + var(--v3) + var(--v4));
    --p1: calc(var(--v1)/var(--total)*100%);
    --p2: calc((var(--v1) + var(--v2)) / var(--total) * 100%);
    --p3: calc((var(--v1) + var(--v2) + var(--v3)) / var(--total) * 100%);
    --p4: 100%;
    background: conic-gradient( var(--chart-red) 0% calc(var(--p1) * var(--progress)), var(--chart-blue) calc(var(--p1) * var(--progress)) calc(var(--p2) * var(--progress)), var(--chart-white) calc(var(--p2) * var(--progress)) calc(var(--p3) * var(--progress)), var(--chart-yellow) calc(var(--p3) * var(--progress)) calc(var(--p4) * var(--progress)), transparent calc(var(--p4) * var(--progress)) calc(100% * var(--progress)));
    animation: growChart 1.2s ease-out forwards;
}

@property --progress {
    syntax: "<number>";
    inherits: false;
    initial-value: 0;
}

@keyframes growChart {
    from {
        --progress: 0;
    }

    to {
        --progress: 1;
    }
}


.pie-chart::after {
    content: "";
    position: absolute;
    inset: 25%; /* controls ring thickness */
    background: white;
    border: 1px solid black;
    border-radius: 50%;
    z-index: 1;
}

/* 🏷 Label */
.pie-chart::before {
    content: attr(data-label);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85vw;
    z-index: 2;
    color:#000;
}


.pie-chart li {
    display: none; /* keep accessible for screen readers */
}




.bs5-select .dropdown-toggle.placeholder {
    color: currentColor;
}


.bs5-select .search-box {
    position: relative;
}

.bs5-select .search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    font-size: 1rem;
    opacity: 0.6;
    cursor: pointer;
}

.bs5-select .search-clear:hover {
    opacity: 1;
}

.bs5-select .search-input {
    padding-right: 28px;
}


.form-switch:has(.form-switch-lg) {
    padding-left: 3rem;
}


.form-switch-lg {
    transform: scale(1.6);
}


.modal-header .btn-modal-close {
    margin: -0.5rem -0.5rem -0.5rem auto;
}

.modal-header .btn-modal-close:hover {
    margin: -0.5rem -0.5rem -0.5rem auto;
    color: #b3b3b3
}





.page-item:first-child a {
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
}


.page-item a {
    padding: 0.375rem 0.73rem;
    position: relative;
    display: block;
    color: #ce9233;
    background-color: #fff;
    border: 1px solid #dee2e6;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}


.page-item.active a {
    z-index: 3;
    color: #fff;
    background-color: #ce9233;
    border-color: #ce9233;
}











.bracket {
    display: flex;
    gap: 20px;
    padding: 30px;
    font-family: Arial;
}

.round {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.round-title {
    font-weight: bold;
    margin-bottom: 18px;
}

.round-matches {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-around;
}

.match {
    position: relative;
    width: 220px;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #fafafa;
    margin: 0.3em;
}

.team {
    display: flex;
    justify-content: space-between;
    padding: 2px 5px;
}

    /* .team:first-child {
        border-bottom: 1px solid #ddd;
    }*/

    .team span:last-child {
        color: red;
    }

    .team.winner span:last-child {
        color: green;
        font-size: 20px;
    }

/* connector to next round */

.match::after {
    content: "";
    position: absolute;
    right: -45px;
    top: 50%;
    width: 45px;
    height: 2px;
    background: #bbb;
}

/* vertical join */

.match::before {
    content: "";
    position: absolute;
    right: -45px;
    top: 50%;
    height: var(--bs-height);
    width: 2px;
    background: #bbb;
}

/* even matches connect upward instead */
.match:nth-child(even)::before {
    top: auto;
    bottom: 50%;
}


.round:last-child .match::after,
.round:last-child .match::before {
    display: none;
}
