/* ========================================
   IMPORTS
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');
@import url('/cdn/fontawesome/css/all.css');
@import url('/cdn/bootstrap/css/bootstrap.min.css');
@import url('/cdn/bootstrap-icons/bootstrap-icons.min.css');
@import url('/cdn/odometer/odometer.css');

/* ========================================
   BASE STYLES
   ======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    margin: 0;
    padding-bottom: 50px;
}

body {
    font-family: "Roboto", sans-serif;
    background-image: url('../images/topography-inverse.svg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-color:rgb(22, 29, 41); /* #4fff5670;*/
    overflow-x: hidden;
}


/* ========================================
   CARDS
   ======================================== */
.card {
    position: relative;
    background: 
        url('../images/topography.svg'),
        #046f1fc6;
    background-size: cover;
    background-position: center;
    border: none;
    border-radius: 20px;
}

.card-flip-back {
    overflow: visible !important;
}

/* Couche de gradient avec opacity pour transition fluide */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        url('../images/topography.svg'),
        linear-gradient(to bottom, #048525, #27b64a);
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
    z-index: 0;
    border-radius: 20px;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card-flip-back .card-body,
.card-flip-back .card-body > * {
    position: static !important;
    z-index: auto !important;
}

.card.partially-visible {
    color: #fff;
}

.card.partially-visible::before {
    opacity: 0.3;
}

.card.fully-visible {
    color: #fff;
}

.card.fully-visible::before {
    opacity: 1;
}

.card.card-flip-back {
    background: 
        url('../images/topography.svg'),
        linear-gradient(to bottom, #048525, #27b64a);
    color: #fff;
}

.card.card-flip-back::before {
    display: none;
}

.card.card-flip-back > * {
    z-index: auto;
}

.shadow {
    box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.5) !important;
}


/* ========================================
   RACEBOX ELEMENTS
   ======================================== */
.racebox-title {
    font-weight: 600;
}

.racebox-desc {
    display: flex;
    height: 50px;
    justify-content: center;
    align-items: center;
}

.racebox-distance {
    font-size: 3em;
    font-weight: 700;
    text-shadow: 1px 1px 4px #000000;
}

.racebox-elevation {
    font-size: 2em;
    font-weight: 700;
}

.racebox-hour {
    font-size: 1.5em;
    text-shadow: 1px 1px 2px #000000;
}

.racebox-spec-children {
    padding-top: 24px;
    padding-bottom: 24px;
    height: 96px;
}


/* ========================================
   COULEURS DES DISTANCES
   ======================================== */
.distance-32k {
    color: #e7620d;
}

.distance-22k {
    color: #00b5fe;
}

.distance-t12k {
    color: #eafb27;
}

.distance-m12k {
    color: #38ffdd;
}

.distance-eveils,
.distance-poussins,
.distance-benjamins,
.distance-minimes {
    color: #c09cff;
}


/* ========================================
   SÉPARATEURS
   ======================================== */
hr.little {
    width: 100px;
    margin: 10px auto;
    border-top: 2px solid #000;
    opacity: 0.5;
}

hr.big {
    width: 100%;
    margin: 25px auto 15px auto;
    border-top: 2px solid #ffffff;
    opacity: 0.7;
}

.racebox-divider-container {
    display: flex;
    align-items: center;
    width: 50%;
    margin: 10px auto;
    color: #ffffff;
}

.racebox-divider-icon {
    width: 75px;
}

.racebox-divider {
    vertical-align: middle;
    position: relative;
    border-bottom: 1px solid;
    flex-grow: 1;
}


/* ========================================
   FLIP CARDS 3D
   ======================================== */
.card-flip-container {
    perspective: 1000px;
    width: 100%;
    position: relative;
}

.card-flip {
    position: relative;
    width: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip-container.flipped .card-flip {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    min-height: 100%;
}

.card-flip-back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: rotateY(180deg);
    isolation: isolate;
    z-index: 2;
}

.card-flip-back .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
}

.card-flip-back-desc {
    flex: 1;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    min-height: 0;
}


/* ========================================
   BOUTON FLIP
   ======================================== */
.btn-flip {
    background: #1ee322;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 150px;
    margin: auto;
    position: relative;
    bottom: 5px;
}

.btn-flip-back {
    width: 105px;
    padding: 5px;
    font-size: 14px;
    text-decoration: none;
}

.btn-flip:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: #16aa19;
}

.btn-flip:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-flip i {
    margin-right: 6px;
}


/* ========================================
   RIBBON BADGES
   ======================================== */
.ribbon-badge {
    position: absolute;
    top: 15px;
    left: -5px;
    background: #c0392b;
    color: #fff;
    padding: 8px;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.ribbon-badge::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 5px 5px;
    border-color: transparent transparent #8b2a1e transparent;
}

.ribbon-badge::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 21px 0;
    border-color: transparent #c0392b transparent transparent;
}

.ribbon-badge:nth-of-type(2) {
    top: 60px;
    font-size: 14px;
}

.ribbon-badge-rate {
    background: #0d6efd !important;
    font-size: 22px;
}

.ribbon-badge-rate::before {
    border-color: transparent transparent #094297 transparent;
}

.ribbon-badge-rate::after {
    border-color: transparent #0d6efd transparent transparent;
}


/* ========================================
   MEDIA QUERIES - MOBILE
   ======================================== */
@media (max-width: 767.98px) {
    .container {
        width: calc(100% - 10px);
        max-width: calc(100% - 10px);
        margin-left: 5px;
        margin-right: 5px;
    }

    .racebox-distance {
        font-size: 2em;
        font-weight: 700;
    }

    .racebox-elevation {
        font-size: 1.5em;
        font-weight: 700;
    }

    .ribbon-badge-rate {
        font-size: 14px;
    }

    .ribbon-badge:nth-of-type(2) {
        top: 50px;
        font-size: 14px;
    }
}

@media (max-width: 575.98px) {
    .you-choose {
        font-size: 0.80rem;
    }

   .ribbon-badge-new {
        font-size: 0.65em;
   }
}