@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

html {
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;

  body {
    margin: 0;
    padding: 0;
    background: #0b1220;
    color: #e6edf7;

    header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px;
      background: #0e1a33;

      h1 {
        margin: 0;
        font-size: 20px;
        letter-spacing: 0.2px;

        a {
          color: white;
          text-decoration: none;

          &:hover {
            text-decoration: underline;
          }
        }
      }

      nav {
        & > div {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 0.75em;

          /* Style pour le lien Contexte transformé en bouton */
          .nav-link {
            text-decoration: none;
            color: white;
            font-size: 13px;
            font-weight: 500;
            background: rgba(124, 169, 255, 0.12);
            border: 1px solid rgba(124, 169, 255, 0.35);
            border-radius: 10px;
            padding: 6px 14px;
            transition: 0.18s ease;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            margin-left: 16px;
          }

          .nav-link:hover {
            background: rgba(124, 169, 255, 0.25);
            border-color: rgba(124, 169, 255, 0.8);
            transform: translateY(-1px);
          }

          label {
            color: rgba(230, 237, 247, 0.82);
            font-size: 13px;
            margin-right: 6px;
          }

          select,
          option {
            font-size: 14px;
          }

          select {
            color: white;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 10px;
            padding: 6px 10px;
            outline: none;
            cursor: pointer;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
            transition: 0.18s ease;
          }

          select:hover {
            border-color: rgba(124, 169, 255, 0.45);
            background: rgba(255, 255, 255, 0.08);
          }

          select:focus {
            border-color: rgba(124, 169, 255, 0.8);
          }

          option {
            background: #0e1a33;
          }
        }
      }
    }

    main {
      display: grid;
      grid-template-columns: repeat(12, 1fr);
      grid-template-rows: 1fr 1fr;
      height: calc(100vh - 63px - 44px);

      #tooltip {
        position: absolute;
        background: rgba(13, 23, 44, 0.96);
        border: 1px solid rgba(124, 169, 255, 0.35);
        color: #fff;
        padding: 10px 12px;
        border-radius: 10px;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.1s ease, transform 0.1s ease;
        transform: translateY(-2px);
        line-height: 1.45;
        top: 0;
        left: 0;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
        font-size: 13px;
        backdrop-filter: blur(6px);
      }

      #opening_explorer {
        grid-column: 1 / 5;
        grid-row: 1 / 2;

        .opening-explorer-wrapper {
          display: flex;
          flex-direction: column;
          gap: 10px;
          height: 100%;

          .oe-bottom {
            display: flex;
            flex-direction: column;
            gap: 10px;
          }
        }
      }

      #chessboard {
        grid-column: 5 / 9;
        grid-row: 1 / 2;
        height: 350px;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 16px;
      }

      #details {
        grid-column: 9 / 13;
        grid-row: 1 / 2;
        position: relative;
        padding-right: 24px;
        padding-top: 24px;
        box-sizing: border-box;

        #oe-opening-title {
          font-weight: 700;
          color: white;
        }

        #oe-opening-variant {
          opacity: 0.85;
          color: white;
        }

        .wrap {
          display: flex;
          gap: 8px;
          flex-wrap: wrap;

          button {
            color: #fff;
            border: 1px solid rgba(124, 169, 255, 0.35);
            background: linear-gradient(180deg, rgba(124, 169, 255, 0.16), rgba(124, 169, 255, 0.08));
            border-radius: 12px;
            padding: 9px 14px;
            cursor: pointer;
            font-size: 12px;
            letter-spacing: 0.2px;
            box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
            transition: 0.18s ease;
            margin-top: 16px;

            &:hover {
              border-color: rgba(124, 169, 255, 0.65);
              filter: brightness(1.06);
            }
          }
        }

        #oe-opening-variant {
          margin-top: 8px;
        }

        #oe-current-pgn {
          box-sizing: border-box;
          margin-top: 16px;
          width: 100%;
          max-height: 110px;
          overflow: auto;
          white-space: pre-wrap;
          color: white;
          background: rgba(255, 255, 255, .06);
          border: 1px solid rgba(255, 255, 255, .12);
          border-radius: 10px;
          padding: 10px;
        }
      }

      #popularity {
        grid-column: 1 / 7;
        grid-row: 2 / 3;
      }

      #accuracy {
        grid-column: 7 / 13;
        grid-row: 2 / 3;
      }
    }

    footer {
      text-align: center;
      padding: 14px;
      background: #0b1220;

      p {
        margin: 0;
        font-size: 13px;
        color: rgba(230, 237, 247, 0.72);
      }

      a {
        color: rgba(124, 169, 255, 0.9);
        text-decoration: none;
        border-bottom: 1px solid rgba(124, 169, 255, 0.35);
        transition: 0.18s ease;
      }

      a:hover {
        color: rgba(160, 198, 255, 1);
        border-bottom-color: rgba(160, 198, 255, 0.6);
      }
    }
  }
}