@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* https://kilianvalkhof.com/2022/css-html/your-css-reset-needs-text-size-adjust-probably/ */
  html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
  }

  body,
  h1,
  h2,
  h3,
  h4,
  p,
  figure,
  blockquote,
  dl,
  dd {
    margin: 0;
  }

  /* https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html */
  ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  body {
    min-block-size: 100vh;
    line-height: 1.6;
  }

  h1,
  h2,
  h3,
  button,
  input,
  label {
    line-height: 1.1;
  }

  h1,
  h2,
  h3,
  h4 {
    text-wrap: balance;
  }

  p,
  li {
    text-wrap: pretty;
  }

  img,
  picture {
    max-inline-size: 100%;
    display: block;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
  }
}

@layer base {
  :root {
    --black: #04070b;
    --primary: #ff7715;
    --light-black: #131d2a;
    --white: #fff;
    --light-gray: #eeeeee;
    --gray: #b1b1b1;
    --dark-gray: #6d7a8b;
    --movie_modal_width: 400px;
    --dark-blue: #3d4e67;
    --border-radius-1: 3.75rem;
    --border-radius-2: 1.875rem;
    --border-radius-3: 1rem;
  }

  @view-transition {
    navigation: auto;
  }

  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }

  html {
    scroll-padding: 2rem;
    overflow-x: hidden;
  }
  body {
    font-family: "Ubuntu Sans", sans-serif;
    font-size: 1rem;
    background: var(--black);
    color: var(--white);
  }

  h1 {
    font-weight: 600;
    font-size: 3rem;
    color: var(--white);

    @media (max-width: 767px) {
      font-size: 2.5rem;
    }
  }

  h2 {
    font-size: 1.875rem;
  }

  p {
    font-size: 1rem;
  }

  .btn {
    cursor: pointer;
  }

  a {
    color: var(--white);
  }

  a:hover,
  a:focus-visible {
    color: var(--primary);
  }
}

@layer layout {
  .wrapper {
    --wrapper-max-width: 1160px;
    --wrapper-padding: 1rem;

    max-width: var(--wrapper-max-width);
    margin-inline: auto;
    padding-inline: var(--wrapper-padding);

    /* helps to match the Figma file */
    box-sizing: content-box;
  }

  .wrapper[data-width="narrow"] {
    --wrapper-max-width: 960px;
  }
  .wrapper[data-width="narrowXS"] {
    --wrapper-max-width: 400px;
  }

  .wrapper[data-width="wide"] {
    --wrapper-max-width: 1440px;
  }
  .section {
    padding-block: 6.25rem;

    @media (max-width: 760px) {
      padding-block: 2.25rem;
    }
    &[data-padding="compact"] {
      padding-block: 4.5rem;
      @media (max-width: 760px) {
        padding-block: 2.25rem;
      }
    }
  }

  .no-padding-top {
    padding-top: 0 !important;
  }
  .content_section {
    background: var(--black);

    @media (max-width: 768px) {
      flex-direction: column;

      .grid-item {
        order: 2;
      }

      .grid-item:has(img) {
        order: 1;
      }
    }

    .grid-item-text {
      padding-inline: 6.25rem;
      padding-block: 3.125rem;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      align-items: flex-start;

      @media (max-width: 1136px) {
        padding-inline: 3.125rem;
        padding-block: 1.5rem;
        gap: 1rem;

        .btn {
          padding: 1rem 2rem;
          font-size: 1.25rem;
        }
      }

      @media (max-width: 768px) {
        padding: 2rem 1rem;
        text-align: center;
        align-items: center;
        gap: 1rem;
      }

      h2 {
        @media (max-width: 768px) {
          font-size: 1.5rem;
        }
      }

      p {
        @media (max-width: 768px) {
          font-size: 1rem;
        }
      }
    }
    .grid-item {
      flex: 1;

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
  }
  .modal-grid {
    display: grid;
    place-items: center;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    height: 100%;

    @media screen and (max-width: 815px) {
      grid-template-columns: 1fr;
    }
  }

  .grid {
    display: grid;
    gap: 2.5rem;
    grid-template-columns: 1fr 1fr;

    @media (max-width: 767px) {
      grid-template-columns: 1fr;
    }

    .grid-item img {
      margin: 0 auto;
    }
  }

  .trending-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;

    @media screen and (max-width: 1120px) {
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      justify-items: center;
    }
  }
}
@layer components {
  /* Navigation  */
  .site_header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    padding: 1.25rem 2.5rem;
    align-items: center;

    @media screen and (max-width: 650px) {
      padding: 1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
  }

  .logo_header {
    grid-column: 2;
    justify-self: center;
    max-width: 240px;
    width: 100%;

    @media screen and (max-width: 767px) {
      max-width: 200px;
    }
  }

  .site_navigation {
    grid-column: 3;
    justify-self: end;

    @media screen and (max-width: 650px) {
      position: fixed;
      inset: 0;
      background: var(--black);
      transform: translateX(100%);
      transition: transform 0.3s ease-in-out;
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      left: 100%;
      z-index: 2;
      right: 0;
      left: auto;
      height: 100%;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch; /* Add for iOS smooth scrolling */
      -webkit-transform: translateX(100%); /* Ensure compatibility with older iOS */

      &.active {
        transform: translateX(0);
        -webkit-transform: translateX(0); /* For iOS compatibility */
      }

      ul {
        flex-direction: column;
        align-items: center;
        gap: 2rem;

        a {
          font-size: 1.5rem;
        }
      }
    }
  }

  .site_navigation ul {
    display: flex;
    gap: 1.25rem;

    a {
      text-decoration: none;
      font-weight: 700;
    }
  }

  .hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
    z-index: 3;

    span {
      display: block;
      width: 30px;
      height: 3px;
      background-color: var(--primary);
      transition: 0.3s ease-in-out;
    }

    @media screen and (max-width: 650px) {
      display: flex;
      align-items: flex-end;
    }
  }

  /* When menu is open */
  .hamburger.active {
    span:first-child {
      transform: translateY(9px) rotate(45deg);
    }
    span:nth-child(2) {
      opacity: 0;
    }
    span:last-child {
      transform: translateY(-9px) rotate(-45deg);
    }
  }

  .hero {
    padding: 150px 20px;

    &.home {
      background: url(../../images/premium/hero-streaming.jpg) center no-repeat;
      background-size: cover;
    }

    .hero-text {
      color: var(--white);
      margin: 0 auto;
      gap: 30px;

      h1 {
        font-size: 48px;
        font-weight: 700;
        text-align: center;
      }

      p {
        font-size: 24px;
        line-height: normal;
        max-width: 720px;
        font-weight: 500;
        text-align: center;
      }
    }
  }

  .zone-section {
    padding: 50px 20px;
    background: var(--dark-blue);

    .wrapper {
      background: var(--black);
      padding: 30px;
      border-radius: 30px;
    }
  }

  .btn {
    display: flex;
    padding: 0.75rem 3rem;
    justify-content: center;
    align-items: center;
    border-radius: var(--border-radius-1);
    border: none;
    color: var(--black);
    background: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    transition: all 0.3s ease-out;
    cursor: pointer;
    text-decoration: none;
    width: fit-content;

    &:hover {
      filter: brightness(1.2);
      transform: scale(1.05);
    }

    @media (max-width: 767px) {
      font-size: 1.25rem;
      padding: 0.875rem 2rem;
    }
  }
  .cards {
    flex-wrap: wrap;

    .card {
      background-size: cover;
      border-radius: 50%;
      padding: 3rem;
      width: 100%;
      max-width: 320px;
      box-sizing: border-box;
      min-height: 320px;
      display: flex;
      justify-content: center;
      align-items: center;
      border: 8px solid var(--light-black);

      .btn {
        background: #1a152880;
        color: var(--primary);
        padding: 3px;
        font-size: 1.5rem;
        border-radius: 50%;
        width: 80%;
        height: 80%;
      }
    }

    .card:nth-child(1) {
      background: url(../../images/premium/card1.png) center no-repeat;
    }
    .card:nth-child(2) {
      background: url(../../images/premium/card2.png) center no-repeat;
    }
    .card:nth-child(3) {
      background: url(../../images/premium/card3.png) center no-repeat;
    }
    .card:nth-child(4) {
      background: url(../../images/premium/card4.png) center no-repeat;
    }
  }

  .games-sidebar {
    border-radius: var(--border-radius-3);
    overflow: hidden;
    margin-bottom: 100px;

    > div {
      padding: 3rem 2rem;
    }
  }

  .games-section {
    .trending-grid img {
      width: 275px;
      height: auto;
      border-radius: 10px;
      cursor: pointer;
      transition: all 0.2s ease-out;

      &:hover {
        transform: scale(1.05);
      }
    }

    h3 {
      margin-bottom: 2rem;
      font-size: 24px;
      font-weight: 500;
      line-height: normal;
      text-transform: uppercase;
      text-align: center;
      padding: 10px 20px;
      border-radius: var(--border-radius-3);
    }
  }

  footer {
    padding: 3rem 0;

    @media (max-width: 767px) {
      padding: 2rem 0;
    }

    .footer-content {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2rem;
      text-align: center;

      .footer_nav ul {
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;

        a {
          text-transform: uppercase;
          font-weight: 700;
          text-decoration: none;
        }
      }

      .payment {
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
      }

      @media (max-width: 767px) {
        gap: 1.5rem;

        img {
          max-width: 150px;
        }
      }
    }
  }
  /* Modals  */
  .otp-modal,
  .login-modal,
  .unsub-modal,
  .sign-up-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;

    .close {
      position: absolute;
      right: 1.25rem;
      top: 1rem;
      font-size: 2rem;
      cursor: pointer;
      color: var(--black);

      @media screen and (max-width: 815px) {
        right: 0.5rem;
        top: 0.2rem;
      }
    }

    .form-group {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      padding: 3rem 2rem;

      p {
        font-size: 0.875rem;
        text-align: center;
      }

      @media screen and (max-width: 767px) {
        margin-top: 0;
        gap: 1rem;
        padding: 1.5rem 1rem;
      }
    }

    .checkbox-group {
      label {
        font-size: 0.875rem;
      }

      input[type="checkbox"] {
        accent-color: var(--primary);
      }
    }

    .checkbox-group {
      label {
        font-size: 0.875rem;
      }
    }

    input {
      padding: 0.5rem;
      border: 1px solid var(--gray);
      border-radius: var(--border-radius-2);
    }

    .btn {
      width: 100%;
      margin-top: 1rem;
      padding: 0.75rem;
    }
  }

  .modal-content {
    background: var(--black);
    border-radius: var(--border-radius-3);
    width: 90%;
    height: fit-content;
    overflow: auto;
    max-inline-size: 900px;
    position: relative;

    @media screen and (max-width: 767px) {
      margin-top: 2rem;
      width: 100%;
    }
  }
  .modal-bck {
    background: url(../../images/premium/modal-image.jpg) center no-repeat;
    background-size: cover;
    height: 100%;
    width: 100%;

    @media screen and (max-width: 815px) {
      display: none;
    }
  }
  .modal-form {
    width: 100%;
  }
  .form-group input {
    background: var(--white);
    padding: 0.625rem 1.25rem;

    &:focus-visible {
      outline: none;
      border: 1px solid var(--blue);
    }

    &::placeholder {
      color: var(--gray);
    }

    @media screen and (max-width: 815px) {
      padding: 0.5rem;
    }
  }
}

@layer pages {
  .page-title {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    background: var(--black);

    h1 {
      font-size: 2.4rem;
      margin: 0 !important;
    }
  }
  .page {
    p {
      margin: 15px 0;
      line-height: normal;
    }

    h1,
    h2 {
      margin-top: 50px;
    }

    h3 {
      margin-top: 30px;
    }
    .title-border {
      display: block;
      width: 100%;
      height: 8px;
      margin: 15px 0 20px;
      background: var(--purple);
      border-radius: 4px;
    }
    .info-frame {
      background: var(--black);
      background-size: cover;
      padding: 30px;
      border-radius: 20px;

      h2 {
        margin-top: 0;
      }

      .text-xl {
        font-size: 1.5rem;
        font-weight: 700;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
    }
    ul,
    ol {
      li {
        margin: 15px;
        list-style: disc;
      }
    }
  }
  .btn.primary {
    padding: 12px 40px;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    transition: 0.25s ease-out;

    &:hover {
      transform: scale(1.1);
    }
  }

  .account_page {
    @media screen and (max-width: 750px) {
      flex-direction: column;
    }
  }
}

@layer utilites {
  .bg-dark-blue {
    background: var(--light-black);
  }
  .d-flex {
    display: flex;
  }
  .flex-column {
    flex-direction: column;
  }
  .d-flex .column {
    flex-basis: 50%;
    flex-grow: 1;
  }
  .justify-center {
    justify-content: center;
  }
  .justify-between {
    justify-content: space-between;
  }
  .align-center {
    align-items: center;
  }
  .text-center {
    text-align: center;
  }
  .text-left {
    text-align: left;
  }
  .text-white {
    color: var(--white);
  }
  .text-black {
    color: var(--black);
  }
  .text-light-red {
    color: #fed1ff;
  }
  .g-2 {
    gap: 0.625rem;
  }
  .pt-0 {
    padding-top: 0;
  }
  .pb-5 {
    padding-bottom: 3.125rem;
  }
  .mb-0 {
    margin-bottom: 0;
  }
  .mb-2 {
    margin-bottom: 20px;
  }
  .mb-5 {
    margin-bottom: 3.125rem;
  }
  .gap-20 {
    gap: 20px;
  }
  .gap-30 {
    gap: 30px;
  }
  .gap-50 {
    gap: 50px;
  }

  .p-inline {
    padding-inline: 6.25rem;
  }
  .mt-5 {
    margin-top: 3.125rem;
  }
  .mt-20 {
    margin-top: 20px;
  }
}
