// ============================================================
// VARIABLES
// ============================================================
$color-green:       #21E273;
$color-orange:      #FF6600;
$color-orange-dark: #FF4E00;
$color-orange-mid:  #FF9500;
$color-orange-light:#FF9900;
$color-bg-dark:     #0D0E25;
$color-bg-card:     #26273B;
$color-bg-black:    #151525;
$color-border:      #2D2E45;
$color-border-card: #3F415E;
$color-text-muted:  #8E90B9;
$color-white:       #FFFFFF;

$font-body:         'Inter', sans-serif;
$font-heading:      "sofia-pro", sans-serif;
$font-comix:        "comix loud", sans-serif;

$radius-sm:         10px;
$radius-md:         20px;
$radius-full:       50px;

$bp-tablet:         1024px;
$bp-mobile:         768px;

// ============================================================
// ROOT
// ============================================================
html { overflow-x: hidden; }

.pageWrapperClassement {
  min-height: 100vh;
  padding: 0 330px;

  @media (max-width: $bp-tablet) { padding: 0 40px; }
  @media (max-width: $bp-mobile) { padding: 0; }

  // ============================================================
  // CONTENT WRAPPER
  // ============================================================
  .contentWrapper {
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    color: $color-white;
    font-family: $font-body;
    position: relative;
    width: 100%;

    @media (max-width: $bp-mobile) { padding: 0 16px; width: -webkit-fill-available; }
  }

  // ============================================================
  // HERO
  // ============================================================
  .heroClassement {
    padding: 60px 0 40px;

    @media (max-width: $bp-mobile) { padding: 30px 0 24px; }

    h1 {
      font-family: $font-heading;
      font-size: 72px;
      font-weight: 700;
      width: 852px;
      margin: 0 auto 20px;
      text-align: center;

      @media (max-width: $bp-tablet) { font-size: 48px; width: 100%; }
      @media (max-width: $bp-mobile) { font-size: 32px; width: 100%; }

      .vert { color: $color-green; }
    }
  }

  .countrySelector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;

    @media (max-width: $bp-mobile) {
      gap: 8px;
      margin: 16px 0;
      flex-wrap: wrap;
    }

    a {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 16px;
      border-radius: $radius-sm;
      background: rgba($color-white, 0.05);
      border: 1px solid $color-border-card;
      text-decoration: none;
      color: $color-text-muted;
      font-size: 14px;
      transition: 0.3s;

      @media (max-width: $bp-mobile) {
        padding: 6px 12px;
        font-size: 13px;
      }

      &:hover,
      &.active {
        border-color: $color-green;
        color: $color-green;
        background: rgba(33, 226, 115, 0.1);
      }
    }
  }

  .heroDesc {
    color: $color-white;
    margin-bottom: 30px;
    font-size: 17px;
    font-weight: 400;
  }

  .outlineButton {
    font-family: $font-heading;
    font-weight: 600;
    font-size: 16px;
    width: auto !important;
  }

  .btnHero {
    display: inline-block;
    padding: 12px 28px;
    border: 1px solid $color-border;
    background: rgba($color-white, 0.05);
    color: $color-white;
    border-radius: $radius-full;
    text-decoration: none;
    font-size: 14px;
    transition: 0.3s;

    &:hover {
      background: $color-green;
      color: $color-bg-dark;
      border-color: $color-green;
    }
  }

  // ============================================================
  // PODIUM
  // ============================================================
  .podiumContainer {
    position: relative;
    border-radius: $radius-md;
    padding: 60px 20px 80px;
    margin-bottom: 80px;
    overflow: visible;
    border: 1px solid transparent;
    background:
            linear-gradient($color-bg-card, $color-bg-card) padding-box,
            linear-gradient(90deg, $color-orange-dark 0%, $color-orange 50%, $color-orange-mid 100%) border-box;

    @media (max-width: $bp-mobile) {
      padding: 30px 16px 40px;
      margin-bottom: 40px;
    }

    h3 {
      text-align: center;
      font-family: $font-heading;
      font-size: 26px;
      margin-bottom: 60px;
      position: relative;
      z-index: 5;

      @media (max-width: $bp-mobile) {
        font-size: 20px;
        margin-bottom: 30px;
      }

      .orange { color: $color-orange; font-weight: 800; }
    }

    // --- Pièces décoratives ---
    // Gauche
    .coin-1  { width: 73px;  height: 70px;  top: 124px; left: 64px; }
    .coin-2  { width: 107px; height: 104px; top: 246px; left: 119px; }
    .coin-3  { width: 63px;  height: 60px;  top: 421px; left: 55px; }
    .coin-4  { width: 62px;  height: 60px;  top: 563px; left: 157px; }
    // Droite
    .coin-1r { width: 73px;  height: 70px;  top: 91px;  left: 1160px; }
    .coin-2r { width: 107px; height: 104px; top: 210px; left: 1040px; }
    .coin-3r { width: 63px;  height: 60px;  top: 373px; left: 1143px; }
    .coin-4r { width: 62px;  height: 60px;  top: 563px; left: 1064px; }

    @media (max-width: $bp-mobile) {
      .coin-1, .coin-2, .coin-3, .coin-4,
      .coin-1r, .coin-2r, .coin-3r, .coin-4r { display: none; }
    }
  }

  .podiumWrapper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 25px;
    margin: 0 auto;
    position: relative;
    z-index: 2;

    @media (max-width: $bp-mobile) {
      flex-direction: column;
      align-items: center;
      gap: 16px;

      & > img { display: none; }
    }
  }

  // --- Cartes podium ---
  .podiumCard {
    background: linear-gradient(180deg, $color-orange-light 0%, #FF5500 100%);
    border-radius: 5px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    color: $color-white;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;

    &.rank-1 { width: 232px; height: 452px; margin-top: 0; }
    &.rank-2 { width: 232px; height: 404px; margin-top: 50px; }
    &.rank-3 { width: 232px; height: 360px; margin-top: 100px; }

    @media (max-width: $bp-mobile) {
      width: 90% !important;
      max-width: 340px;
      height: auto !important;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      padding: 20px 16px;

      &.rank-1 { order: 1; }
      &.rank-2 { order: 2; }
      &.rank-3 { order: 3; }
    }
  }

  // --- Avatar & Badge ---
  .avatar-box {
    position: relative;
    width: 130px;
    height: 130px;
    margin-bottom: 30%;

    @media (max-width: $bp-mobile) {
      width: 90px;
      height: 90px;
      margin-bottom: 40px;
      margin-top: 0;
    }

    .img-border {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      padding: 5px;
      background: linear-gradient(135deg, #FFD700 0%, $color-orange 100%);
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    img {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      object-fit: cover;
      display: block;
      background: #fff;
    }
  }

  // --- Badge de rang (podium + liste top 3) ---
  .rank-badge {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 1.47px 16.19px 0px #000000;
    z-index: 2;

    &.list-badge {
      position: relative;
      bottom: auto;
      left: auto;
      transform: none;
      z-index: 1;
    }

    &::before {
      content: '';
      position: absolute;
      inset: -3px;
      border-radius: 50%;
      background: linear-gradient(189.36deg, #FCCC03 -40.84%, #FC6400 59.47%);
      z-index: 1;
    }

    &::after {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 50%;
      background: #1A1B2F;
      z-index: 2;
    }
  }

  .rank-number {
    position: relative;
    z-index: 3;
    font-family: $font-comix;
    font-weight: 400;
    font-size: 15.77px;
    line-height: 1;
    text-transform: uppercase;
    background: linear-gradient(189.36deg, #FCCC03 -40.84%, #FC6400 59.47%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    height: -webkit-fill-available;
    display: flex;
    align-items: center;
  }

  // --- Numéro simple (rang 4+) ---
  .simple-rank {
    font-weight: 400;
    font-size: 20px;
    color: $color-white;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  // --- Expert info ---
  .expert-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex-grow: 1;
    justify-content: space-between;
  }

  .name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 5px;
  }

  .name {
    font-family: $font-heading;
    font-weight: 800;
    font-size: 18px;
    margin: 0;
    text-transform: capitalize;
    line-height: 1.2;
  }

  .linkedin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: $color-white;
    border-radius: 4px;
    color: $color-orange;
    font-size: 14px;
    text-decoration: none;
    transition: 0.2s;
    font-weight: 700;
    line-height: 26px;
    letter-spacing: 0%;
    vertical-align: middle;

    &:hover { transform: scale(1.1); }
  }

  .divider {
    width: 162px;
    height: 0;
    border: 1px solid $color-white;
    margin: 20px 0;
  }

  .certif-title {
    font-weight: 400;
    font-size: 16px;
    line-height: 23px;
    letter-spacing: 0%;
    text-align: center;
    vertical-align: middle;
  }

  .xp-pill {
    display: flex;
    align-items: center;
    gap: 4.4px;
    padding: 3px 10px;
    border-radius: $radius-full;
    border: 1px solid rgba($color-white, 0.5);
    color: $color-white;
    width: 150px;
    height: 32px;
    justify-content: center;
    font-weight: 400;
    font-size: 17.3px;
    line-height: 100%;
    letter-spacing: 0%;
    vertical-align: middle;

    .coin-icon {
      width: 30px;
      height: 30px;

      & > img { width: -webkit-fill-available; }
    }
  }

  // ============================================================
  // RANKING LIST (TABLEAU)
  // ============================================================
  .rankingListContainer {
    margin-top: 50px;
    text-align: left;
    background: $color-bg-card;
    border-radius: 10px;
    padding: 60px 120px;

    @media (max-width: $bp-tablet) { padding: 40px 30px; }
    @media (max-width: $bp-mobile) { padding: 24px 12px; margin-top: 24px; }

    h3 {
      text-align: center;
      font-size: 24px;
      margin-bottom: 40px;
      color: $color-white;

      @media (max-width: $bp-mobile) { font-size: 18px; margin-bottom: 20px; }
    }
  }

  .list-header {
    display: grid;
    grid-template-columns: 60px 2fr 2fr 2fr 1fr;
    padding: 0 20px 10px;
    border-bottom: 1px solid rgba($color-white, 0.1);
    margin-bottom: 10px;
    color: $color-text-muted;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;

    @media (max-width: $bp-mobile) { display: none; }
  }

  // Colonnes globales
  .col          { padding: 0 10px; }
  .col-rank     { text-align: center; display: flex; align-items: center; justify-content: center; padding-top: 4px; }
  .col-profile  { display: flex; align-items: flex-start; gap: 15px; }
  .col-certif   { font-size: 14px; opacity: 0.9; display: flex; align-items: center; }
  .col-progress { display: flex; align-items: center; gap: 15px; }
  .col-action   { text-align: right; display: flex; align-items: center; justify-content: flex-end; }

  // --- Lignes ---
  .rank-row {
    display: flex;
    padding: 15px 20px;
    margin-bottom: 10px;
    transition: transform 0.2s;
    align-items: stretch;

    &:hover { transform: scale(1.01); }

    // ── TOP ROWS (rangs 1–3) ──────────────────────────────────
    &.top-row {
      background: linear-gradient(90deg, #FF4E00 0%, #FF6600 50%, #FF9500 100%);
      box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
      color: $color-white;
      border: none;
      padding: 20px 30px;
      display: flex;
      flex-direction: column;

      .col-top {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
      }

      .top-row-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.4);
        margin: 16px 0;
        width: 100%;
      }

      .profile-details {
        width: max-content;
        display: flex;
        align-items: center;
        flex-direction: row;
      }

      .col-bottom {
        display: flex;
        align-items: center;
        width: -webkit-fill-available;
        padding-left: calc((100% - 80px) * 2 / 7);
        justify-content: space-evenly;

        & > * { flex: unset; }

        .col-certif {
          font-size: 14px;
          font-weight: 400;
          white-space: nowrap;
        }

        .col-progress {
          width: 100%;
          gap: 12px;
          display: flex;
          justify-content: center;
          padding: 0 15px;
        }

        .col-action { margin-left: auto; }
      }

      .profile-info-wrap {
        display: flex;
        align-items: center;
        gap: 15px;
        width: -webkit-fill-available;
      }

      .list-avatar {
        width: 50px;
        height: 50px;
        border: none;
        background: #FFF;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
      }

      .list-name {
        font-size: 18px;
        font-weight: 400;
      }

      .list-linkedin {
        color: $color-orange;
        width: 26px;
        height: 26px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        font-size: 14px;
        text-decoration: none;
        margin-left: 10px;
        flex-shrink: 0;

        &:hover { transform: scale(1.1); }
        & > i { font-size: 24px; }
      }

      .profile-desc {
        font-size: 12px;
        line-height: 1.4;
        color: #000000;
        margin: 0;
        font-weight: 400;
      }

      .progress-track {
        background: rgba(0, 0, 0, 0.2);
        width: -webkit-fill-available;
        height: 12px;
        border-radius: 20px;
        overflow: hidden;
      }

      .progress-fill {
        background: #151525;
        border-radius: 20px;
        height: 100%;
      }

      .score-text {
        font-size: 14px;
        font-weight: bold;
        min-width: 60px;
      }

      .btn-view {
        background: transparent;
        color: $color-white;
        border: 1px solid $color-white;
        border-radius: 50px;
        padding: 5px 25px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        font-weight: 400;
        text-decoration: none;
        white-space: nowrap;
        transition: background 0.3s, color 0.3s;

        & > i { transition: background 0.3s, color 0.3s; }

        &:hover {
          background: $color-white;
          color: $color-orange;
          & > i { color: $color-orange; }
        }
      }
    }

    // ── STANDARD ROWS (rang 4+) ───────────────────────────────
    &.standard-row {
      display: grid;
      grid-template-columns: 60px 2fr 2fr 3fr 1fr;
      align-items: center;
      padding: 10px 20px !important;
      border-bottom: 1px solid #57597E;
      margin-bottom: 10px;

      &:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
      }

      & > .col-top           { display: contents; }
      & > .col-top > .col-profile { display: contents; }

      & > .col-top > .col-profile > .col-rank {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: unset;

        .simple-rank { font-size: 20px; }
        .rank-badge.list-badge { position: relative; bottom: auto; left: auto; transform: none; }
      }

      & > .col-top > .col-profile > .profile-info-wrap {
        display: flex;
        align-items: center;
        gap: 15px;
      }

      .col-certif,
      .col-progress,
      .col-action {
        flex: unset;
        width: auto;

        & > .certif-label { width: max-content; }
      }

      .col-progress {
        gap: 10px;
        .progress-track { flex: 1; }
      }

      .profile-info-wrap {
        display: flex;
        align-items: center;
        gap: 15px;
      }

      .list-avatar {
        width: 27px;
        height: 27px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba($color-white, 0.2);
      }

      .list-name {
        font-weight: 400;
        font-size: 14px;
        line-height: 26px;
        letter-spacing: 0%;
        vertical-align: middle;
      }

      .list-linkedin {
        color: $color-white;
        font-size: 18px;
        opacity: 1;
        margin-left: 10px;
        &:hover { opacity: 1; }
      }

      .profile-desc { display: none; }

      .progress-track {
        flex-grow: 1;
        height: 8px;
        background: #57597E;
        border-radius: 10px;
        overflow: hidden;
      }

      .progress-fill { height: 100%; background: $color-green; border-radius: 10px; }

      .score-text { font-size: 12px; font-weight: bold; text-align: right; white-space: nowrap; }

      .btn-view {
        background: transparent;
        color: $color-white;
        border: 1px solid $color-white;
        border-radius: 50px;
        padding: 3px 16px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        font-weight: 400;
        text-decoration: none;
        white-space: nowrap;
        transition: background 0.3s, color 0.3s, border-color 0.3s;

        & > i { transition: background 0.3s, color 0.3s; }

        &:hover {
          background: #57597E;
          color: $color-white;
          border-color: #57597E;
          & > i { color: $color-white; }
        }
      }

      &:hover { background: rgba($color-white, 0.06); }
    }

    // Cache les doublons mobile-only en desktop
    &.standard-row.mobile-only { display: none; }

    // ── RESPONSIVE TABLEAU ────────────────────────────────────
    @media (max-width: $bp-mobile) {
      &.top-row { display: none; }
      &.standard-row.mobile-only { display: grid; }

      &.standard-row {
        display: grid;
        grid-template-columns: 36px 1fr auto;
        grid-template-rows: auto auto auto;
        align-items: center;
        column-gap: 10px;
        row-gap: 6px;
        padding: 12px 10px;

        & > .col-top > .col-profile > .col-rank,
        .col-rank {
          grid-column: 1;
          grid-row: 1;
          width: 36px;
          justify-content: flex-start;

          .simple-rank { font-size: 16px; }
        }

        & > .col-top > .col-profile > .profile-info-wrap,
        .profile-info-wrap {
          grid-column: 2;
          grid-row: 1;
          display: flex;
          flex-direction: row;
          align-items: center;
          gap: 8px;

          .list-avatar { width: 28px; height: 28px; }
          .list-name   { font-size: 13px; }
        }

        .col-action {
          grid-column: 3;
          grid-row: 1;
          width: auto;
          justify-content: flex-end;

          .btn-view { padding: 3px 10px; font-size: 11px; }
        }

        .col-certif {
          grid-column: 1 / -1;
          grid-row: 2;
          width: auto;
          font-size: 12px;
          color: rgba($color-white, 0.65);
          justify-content: flex-start;
          padding-left: 46px;
        }

        .col-progress {
          grid-column: 1 / -1;
          grid-row: 3;
          width: auto !important;
          padding-left: 46px;
          gap: 8px;

          .progress-track { flex: 1; }
          .score-text { font-size: 11px; white-space: nowrap; }
        }

        .profile-desc { display: none; }
      }
    }
  } // fin .rank-row

  // ============================================================
  // CERTIFICATION SECTION
  // ============================================================


} // fin .pageWrapperClassement

.certificationWrapper {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: 860px;
  margin-top: 100px;
  overflow: hidden;
  display: flex;
  justify-content: center;

  @media (max-width: $bp-mobile) { display: none; }

  .bgCertif {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
  }

  .certificationContainer {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    min-height: 860px;

    @media (max-width: $bp-mobile) { flex-direction: column; min-height: auto; }
  }

  .angryLinky {
    position: absolute;
    bottom: 0;
    right: 100px;
    width: 600px;
    height: auto;
    z-index: 2;
    pointer-events: none;

    @media (max-width: $bp-tablet) { width: 400px; right: -100px; opacity: 0.5; }
    @media (max-width: $bp-mobile) { display: none; }
  }

  .certificationContent {
    position: relative;
    margin-top: -50px;
    width: 100%;
    max-width: 700px;
  }

  .certificationTitle {
    position: relative;
    margin-bottom: -40px;
    transform: rotate(-2deg);
    z-index: 3;
    margin-left: 20px;

    #bottomComix {
      font-family: $font-comix;
      font-size: 36px;
      color: $color-green;
      text-transform: uppercase;
      margin: 0;
      line-height: 2;

      @media (max-width: $bp-mobile) { font-size: 32px; }
    }

    h2 {
      font-family: $font-comix;
      font-size: 24px;
      color: $color-white;
      text-transform: uppercase;
      margin: 0;
      line-height: 2;
    }

    span.bg-black {
      font-family: $font-comix;
      background: $color-bg-black;
      padding: 0 10px;
      font-size: 24px;
      transform: skew(-5deg);
    }
  }

  .bubbleContainer {
    position: relative;
    width: 750px;
    height: 380px;
    max-width: 100%;

    @media (max-width: $bp-mobile) {
      width: 100%;
      height: auto;
      background: $color-bg-black;
      border-radius: $radius-md;
      padding: 20px;
      border: 2px solid $color-white;
      margin-top: 20px;
    }
  }

  .bubbleImg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0px 10px 10px rgba(0, 0, 0, 0.3));

    @media (max-width: $bp-mobile) { display: none; }
  }

  .bubbleText {
    position: absolute;
    top: 70px;
    left: 50px;
    width: 600px;
    color: $color-white;
    z-index: 10;
    font-family: $font-body;

    @media (max-width: $bp-mobile) {
      position: relative;
      top: 0;
      left: 0;
      width: 100%;
      text-align: center;
      transform: none;
    }
  }

  .wysiwyg-content p {
    font-size: 18px;
    line-height: 1.4;
    color: $color-white;
    margin-bottom: 15px;
    font-weight: 500;
  }

  #gifted {
    color: $color-green;
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 20px;
    text-transform: uppercase;
  }

  .fillButton {
    color: $color-bg-dark;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: $radius-full;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.2s;
    border: none;
  }

  .no-underline { text-decoration: none; }
}