@use "../../../../styles/abstracts/variables";
@use "../../../../styles/abstracts/mixins";

/* ==========================================
   WEBSITE SETTINGS
========================================== */

.web__settings {
  width: 100%;
  form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  /* ==========================================
     SECTION CARD
  ========================================== */

  .sectionCard {
    // background: linear-gradient(
    //   180deg,
    //   rgba(255, 255, 255, 0.025) 0%,
    //   rgba(255, 255, 255, 0.015) 100%
    // );

    // border: 1px solid rgba(255, 255, 255, 0.06);

    // border-radius: 14px;

    // // padding: 1.5rem;

    // backdrop-filter: blur(20px);

    overflow: hidden;

    @media only screen and (max-width: 1000px) {
      padding: 1rem;
    }
  }

  .sectionHeader {
    margin-bottom: 1.5rem;

    h3 {
      color: #fff;

      font-size: 1rem;

      font-weight: 600;

      margin-bottom: 0.35rem;
    }

    p {
      color: rgba(255, 255, 255, 0.55);

      font-size: 0.78rem;

      line-height: 1.7;
    }
  }

  /* ==========================================
     GRID
  ========================================== */

  &__grid {
    display: grid;

    grid-template-columns: repeat(
      2,
      minmax(0, 1fr)
    );

    gap: 1rem;

    margin-bottom: 1rem;

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

  /* ==========================================
     FORM GROUP
  ========================================== */

  .formGroup {
    display: flex;

    flex-direction: column;

    gap: 0.55rem;

    margin-bottom: 1rem;

    label {
      color: rgba(
        255,
        255,
        255,
        0.82
      );

      font-size: 0.8rem;

      font-weight: 500;

      display: block;
    }

    small {
      color: rgba(
        255,
        255,
        255,
        0.45
      );

      font-size: 0.7rem;

      line-height: 1.6;
    }
  }

  /* ==========================================
     INPUTS
  ========================================== */

  input,
  select,
  textarea {
    width: 100%;

    background: rgba(
      255,
      255,
      255,
      0.025
    );

    border: 1px solid
      rgba(255, 255, 255, 0.08);

    border-radius: 10px;

    padding: 0.85rem 1rem;

    color: #fff;

    font-size: 0.8rem;

    transition: all 0.25s ease;

    box-shadow: none !important;

    &:focus {
      outline: none;

      border-color: rgba(
        247,
        147,
        24,
        0.35
      );

      box-shadow:
        0 0 0 4px
          rgba(
            247,
            147,
            24,
            0.08
          ) !important;
    }

    &::placeholder {
      color: rgba(
        255,
        255,
        255,
        0.32
      );
    }
  }

  select {
    cursor: pointer;

    option {
      background: #111;
      color: #fff;
    }
  }

  textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.8;
  }

  /* ==========================================
     PREMIUM UPLOADS
  ========================================== */

  .uploadCard {
    width: 100%;
  }

  .uploadArea {
    width: 100%;

    min-height: 260px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    gap: 0.85rem;

    border-radius: 14px;

    border: 2px dashed
      rgba(255, 255, 255, 0.08);

    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0.01)
    );

    cursor: pointer;

    transition: all 0.25s ease;

    &:hover {
      border-color: rgba(
        247,
        147,
        24,
        0.35
      );

      background: rgba(
        247,
        147,
        24,
        0.025
      );
    }

    h4 {
      color: #fff;

      font-size: 0.9rem;

      font-weight: 600;
    }

    p {
      color: rgba(
        255,
        255,
        255,
        0.55
      );

      font-size: 0.75rem;
    }

    span {
      color: rgba(
        255,
        255,
        255,
        0.35
      );

      font-size: 0.72rem;
    }
  }

  .uploadIcon {
    width: 60px;
    height: 60px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.6rem;

    color: #f79318;

    background: rgba(
      247,
      147,
      24,
      0.08
    );

    border: 1px solid
      rgba(
        247,
        147,
        24,
        0.18
      );
  }

  /* ==========================================
     IMAGE PREVIEW
  ========================================== */

  .imagePreview {
    width: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 1rem;

    padding: 1rem;

    border-radius: 14px;

    background: rgba(
      255,
      255,
      255,
      0.015
    );

    border: 1px solid
      rgba(255, 255, 255, 0.06);

    img {
      width: 180px;
      height: 180px;

      object-fit: contain;

      border-radius: 12px;

      background: rgba(
        255,
        255,
        255,
        0.03
      );

      padding: 1rem;

      border: 1px solid
        rgba(
          255,
          255,
          255,
          0.06
        );
    }
  }

  .imageMeta {
    text-align: center;

    h5 {
      color: #fff;

      font-size: 0.82rem;

      font-weight: 600;

      margin-bottom: 0.25rem;
    }

    p {
      color: rgba(
        255,
        255,
        255,
        0.45
      );

      font-size: 0.72rem;
    }
  }

  .imageActions {
    display: flex;

    align-items: center;

    gap: 0.75rem;

    flex-wrap: wrap;
  }

  .changeBtn {
    height: 40px;

    padding: 0 1rem;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    cursor: pointer;

    font-size: 0.75rem;

    font-weight: 600;

    color: #fff;

    background: rgba(
      255,
      255,
      255,
      0.05
    );

    border: 1px solid
      rgba(255, 255, 255, 0.08);

    transition: 0.25s ease;

    &:hover {
      background: rgba(
        255,
        255,
        255,
        0.08
      );
    }
  }

  .removeBtn {
    height: 40px;

    padding: 0 1rem;

    border-radius: 10px;

    cursor: pointer;

    font-size: 0.75rem;

    font-weight: 600;

    color: #ef4444;

    background: rgba(
      239,
      68,
      68,
      0.08
    );

    border: 1px solid
      rgba(
        239,
        68,
        68,
        0.15
      );

    transition: 0.25s ease;

    &:hover {
      background: rgba(
        239,
        68,
        68,
        0.14
      );
    }
  }

  /* ==========================================
     TOGGLES
  ========================================== */

  .toggleGrid {
    display: grid;

    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 1rem;

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

  .toggleCard {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 1rem;

    padding: 1rem;

    border-radius: 12px;

    border: 1px solid
      rgba(255, 255, 255, 0.06);

    background: rgba(
      255,
      255,
      255,
      0.02
    );

    h4 {
      color: #fff;

      font-size: 0.82rem;

      font-weight: 600;

      margin-bottom: 0.25rem;
    }

    p {
      color: rgba(
        255,
        255,
        255,
        0.45
      );

      font-size: 0.72rem;

      line-height: 1.6;
    }
  }

  /* ==========================================
     ERRORS
  ========================================== */

  .error {
    color: #ef4444;

    font-size: 0.72rem;

    margin-top: 0.25rem;
  }

  /* ==========================================
     SUBMIT
  ========================================== */

  .submitBtn {
    width: 100%;

    height: 54px;

    border: none;

    border-radius: 12px;

    cursor: pointer;

    font-size: 0.82rem;

    font-weight: 600;

    color: variables.$col-dark;

    background: variables.$col-orange;

    transition: all 0.25s ease;

    &:hover {
      transform: translateY(-1px);

      box-shadow:
        0 15px 35px
          rgba(
            247,
            147,
            24,
            0.25
          );
    }
  }
}

/* ==========================================
   MOBILE
========================================== */

@media only screen and (max-width: 768px) {
  .web__settings {
    .sectionCard {
      padding: 1rem;
    }

    .uploadArea {
      min-height: 220px;
    }

    .imagePreview img {
      width: 140px;
      height: 140px;
    }

    .imageActions {
      width: 100%;

      flex-direction: column;

      .changeBtn,
      .removeBtn {
        width: 100%;
      }
    }
  }
}


/* ==========================================
   PREMIUM SWITCH
========================================== */

.switch {
  position: relative;

  width: 52px;
  height: 30px;

  flex-shrink: 0;

  input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
  }
}

.slider {
  position: absolute;

  inset: 0;

  cursor: pointer;

  border-radius: 999px;

  background: rgba(
    255,
    255,
    255,
    0.08
  );

  border: 1px solid
    rgba(255, 255, 255, 0.08);

  transition: all 0.3s ease;

  backdrop-filter: blur(10px);

  &::before {
    content: "";

    position: absolute;

    width: 22px;
    height: 22px;

    left: 3px;
    top: 3px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
      0 4px 12px
        rgba(0, 0, 0, 0.3),
      inset 0 1px 0
        rgba(255, 255, 255, 0.8);

    transition: all 0.3s ease;
  }
}

/* ACTIVE */

.switch input:checked + .slider {
  background: linear-gradient(
    135deg,
    #f79318,
    #ffb54a
  );

  border-color: rgba(
    247,
    147,
    24,
    0.4
  );

  box-shadow:
    0 0 0 4px
      rgba(
        247,
        147,
        24,
        0.08
      ),
    0 8px 24px
      rgba(
        247,
        147,
        24,
        0.2
      );
}

.switch
  input:checked
  + .slider::before {
  transform: translateX(22px);
}

/* HOVER */

.switch:hover .slider {
  border-color: rgba(
    255,
    255,
    255,
    0.15
  );
}

/* DISABLED */

.switch input:disabled + .slider {
  opacity: 0.5;

  cursor: not-allowed;
}