// Everywhere: use with care

$phone-width: 576px;
$tablet-width: 768px;
$desktop-width: 1024px;
$large-desktop: 1200px;

@mixin brick {
  @media (min-width: #{$phone-width}) {
    @content;
  }
}

@mixin tablet {
  @media (min-width: #{$tablet-width}) {
    @content;
  }
}

@mixin desktop {
  @media (min-width: #{$desktop-width}) {
    @content;
  }
}

@mixin large {
  @media (min-width: #{$large-desktop}) {
    @content;
  }
}

.space-loader {
  width: 100%;
  height: 100%;
  background-color: #fff;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  //background-image: url(../images/preloader.svg);
  background-repeat: no-repeat;
  background-size: 100px;
  background-position: 50% 50%;
  z-index: 999;
  border-radius: var(--global-border-radius) !important;
}

/**
Archive Styles
 */

#space-archive-container {
  .spaces-type-navs {
    margin: 20px 0 30px;

    .spaces-nav {
      margin: 0;

      li {
        padding-right: 30px;
        background-color: transparent;

        a {
          background: transparent;
          font-weight: normal;
          padding: 10px 0;
          text-decoration: none;
        }

        &.selected {
          a {
            border-bottom: 1px solid currentColor;
          }
        }
      }
    }
  }

  .subnav-filters {
    display: flex;
    flex-flow: row wrap;
    margin: 15px 0 15px;
    width: 100%;

    select {
      font-family: inherit;
      font-style: inherit;
      font-size: 16px;
      min-height: 40px;
      outline: 0;
      vertical-align: middle;
      color: inherit;
      box-shadow: none;
      margin: 0;
      padding: 0 12px !important;
      background-repeat: no-repeat !important;
      background-position: right 1rem center !important;
      padding-right: 40px !important;
      border-radius: 8px;
    }

    .subnav-search {
      flex: 1;
      margin-right: 10px;

      .space-search {
        display: flex;
        flex-flow: row wrap;
        gap: 10px;

        .bp-dir-search-form {
          border-radius: 8px;
          box-shadow: none;
          margin: 0;
          padding: 0;
          position: relative;
          width: auto;

          input {
            border: 0;
            background-color: transparent;
            padding-left: 35px;
            font-size: 14px;
            width: 100%;
            height: 40px;
            background-repeat: no-repeat;
            background-position: 10px 50%;
            background-size: 16px;
            background-position: left 10px center;
          }
        }
      }
    }
  }
}

.space-archive-wrapper {
  #space-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    //list-style: none;
    //margin: 0;
    //padding: 0;

    &:before {
      display: none;
    }

    li {
      max-width: none;
      padding: 0 !important;
      margin: 0;

      .space-list-wrap {
        display: flex;
        flex-direction: column;
        height: 100%;
        border: 1px solid lightgrey;
        border-radius: 8px;
        overflow: hidden;
        -webkit-transition: box-shadow linear .2s;
        transition: box-shadow linear .2s;

        .space-cover-img {
          position: relative;
          display: block;
          max-height: 200px;
          padding-top: 200px;
          border-radius: 3px 3px 0 0;
          overflow: hidden;
          background-position: center center;
          background-size: cover;

          .space-category {
            background-color: var(--se-primary-button-background-color);
            color: var(--se-primary-button-text-color);
            display: inline-block;
            padding: 8px 12px;
            font-size: 14px;
            font-weight: bold;
            line-height: 1;
            text-align: center;
            white-space: nowrap;
            vertical-align: baseline;
            border-radius: 0.25rem;
            position: absolute;
            top: 20px;
            left: 20px;
            z-index: 1;
          }
        }

        .space-content-wrap {
          margin: 0;
          padding: 15px;
          text-align: center;
          position: relative;

          .avatar-top {
            height: 48px;
            width: 120px;
            max-width: 120px;
            top: -28px;
            left: -15px;
            position: absolute;

            svg {
              path {
                fill: #fff;
              }
            }

            .avatar-image {
              position: absolute;
              top: 6px;
              left: 50%;
              transform: translate(-50%);
              border-radius: 50%;
              width: 60px;
              height: 60px;
              //border: 4px solid #fff;

              img {
                width: 100%;
                height: 100%;
                border-radius: 50%;
              }
            }
          }

          h3 {
            margin: 0 0 10px;
            font-size: 1.25rem;
            line-height: 28px;
            font-weight: 600;
          }
        }
      }
    }
  }
}

/**
Single Styles
 */
body.buddypress.single-wpe_wpspace #page #primary {
  max-width: 100% !important;
}

#buddypress.buddypress-wrap.space-single {
  #cover-image-container {
      flex-direction: column;
      align-items: center;
      border: 0;
      flex-flow: row wrap;
      height: auto;
      padding: 30px 30px 0;
      font-size: 14px;
      border-radius: 0;
      position: relative;
      z-index: 9;

      .container {
        max-width: 100%;
      }

      &:after {
        content: "";
        display: block;
        width: 100vw;
        height: 100%;
        margin-left: -50vw;
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        z-index: 0;
        background: linear-gradient(to top, #FFFFFF, rgba(255, 255, 255.9), rgba(255, 255, 255, .7), rgba(255, 255, 255, .4), rgba(255, 255, 255, 0));
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
      }

      #header-cover-image {
        background-size: cover;
        background-color: #68717d;
        background-position: center;
        height: 300px;
        margin: -30px -30px 0;
        position: relative;
        width: auto;
      }

      #item-header-cover-image {
        display: flex;
        flex-flow: row wrap;
        margin-left: auto;
        padding: 20px 0;
        position: relative;
        z-index: 2 !important;

        .avatar-top {
          height: 96px;
          width: 240px;
          //max-width: 208px;
          top: -56px;
          left: -15px;
          position: absolute;

          svg {
            path {
              fill: #fff;
            }
          }

          .avatar-image {
            position: absolute;
            top: 6px;
            left: 50%;
            transform: translate(-50%);
            border-radius: 99999px;
            width: 120px;
            height: 120px;
            border: 4px solid #fff;

            img {
              width: 100%;
            }
          }
        }

        #item-header-content {
          margin-left: 200px !important;
          margin-top: 0;
          flex: 1;
          z-index: 1;

          .item-title {
            h2 {
              margin: 0;
            }
          }
        }

        #item-actions {
          display: flex;
          align-items: center;
          justify-content: flex-end;
          gap: 20px;
        }
      }
    }

  .bp-feedback {
    display: flex;
    align-items: center;
    margin: 20px auto !important;
    padding: 0.615em 2.25em 0.615em 0.7em !important;
    font-size: 14px;
    line-height: 1.5;
    color: inherit;
    box-shadow: none;
    max-width: 100% !important;

    &.hidden{
      display: none !important;
    }
  }

  .space-main-nav {
      background: var(--se-content-background-color);
      border: 1px solid var(--se-border-color);
      margin: 20px auto;
      padding: 0 5px;
      box-shadow: none;
      overflow: initial;
      border-radius: var(--se-border-radius);

    ul {
      display: flex;

      li {
        a {
          padding: 16px;
        }

        &.selected, &.current {
          a {
            background: transparent;
            color: var(--se-primary-color);
            outline: 0;
            border-bottom: 3px solid var(--se-primary-color);
          }
        }

        &:not(.selected) {
          a {
            &:hover {
                background: transparent;
                color: var(--se-primary-color);
                outline: 0;
                border-bottom: 3px solid var(--se-primary-color);
            }
          }
        }
      }
    }
  }

  .desc-wrap {
    margin: 20px 0;
    padding: 0;
    background: #fff;
    border: 1px solid lightgrey;
    border-radius: 8px;
    .space-description {
      padding: 15px;
    }
  }

  .space-settings-content {
    display: flex;
    gap: 20px;

    .space-settings-nav {
      width: 100%;

      #space-settings-tabs-nav {
        background: var(--se-content-background-color);
        margin: 0;
        padding: 15px;
        width: auto;
        border: 1px solid var(--se-border-color);
        border-radius: var(--se-border-radius);

        li {
          background: transparent;
          width: 100%;
          padding: 0;

          &#space-setting-general-li {
            a {
              &:before {
                content: '\f108';
              }
            }
          }

          &#space-setting-avatar-li {
            a {
              &:before {
                content: '\f306';
              }
            }
          }

          &#space-setting-cover-li {
            a {
              &:before {
                content: '\f128';
              }
            }
          }

          &#space-setting-action_button-li {
            a {
              &:before {
                content: '\f525';
              }
            }
          }

          &#space-setting-delete-li {
            a {
              &:before {
                content: '\f182';
              }
            }
          }

          a {
            background-color: transparent;
            border: 0;
            color: inherit;
            font-size: 15px;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-align: center;
            -ms-flex-align: center;
            align-items: center;
            margin-bottom: 1px;
            padding: 10px 15px;
            border-radius: 6px;

            &:hover, &:focus {
              background: var(--se-primary-color);
              color: #fff;
              border: 0;
              outline: 0;
            }

            &:before {
              //content: '\f232';
              //font-family: 'Font Awesome 6 Free';
              //font-weight: 900;
              //color: inherit;
              margin-right: 6px;
              //display: inline-block;
              //font-size: inherit;
              //text-rendering: auto;
              //min-width: 20px;
              //text-align: center;
            }
          }
        }
      }

      @include tablet {
        width: 100%;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 230px;
        flex: 0 0 230px;
        float: left;
        margin: 0;
        min-height: 50vh;
        padding: 0;
        border: 0;
        padding: 20px 0;
      }
    }

    #space-settings {
      flex: 1;
      min-width: 1px;
      margin: 0;
      padding: 20px 0 0;

      .item-body-inner {
        position: relative;
        margin: 0 0 16px;
        background-color: var(--se-content-background-color);
        padding: 12px;
        border: 0 solid var(--se-border-color);
        border-radius: var(--se-border-radius) !important;

        .space-screen-title {
          margin: 0 0 1rem !important;
        }

        .space-info {
          label {
            display: block;
            width: 100%;
            margin: 0 0 5px;
          }

          input[type="text"],
          input[type="email"],
          input[type="url"],
          input[type="password"],
          input[type="search"],
          input[type="date"],
          input[type="month"],
          input[type="time"],
          input[type="datetime"],
          input[type="datetime-local"],
          input[type="week"],
          input[type="number"],
          input[type="tel"],
          input[type="color"] {
            display: inline-block;
            font-family: inherit;
            font-style: inherit;
            font-size: 15px;
            min-height: 40px;
            outline: 0;
            vertical-align: middle;
            box-shadow: none;
            margin: 0 !important;
            padding: 0 12px;
            width: 100%;
            border-radius: var(--se-border-radius) !important;
          }
        }

        fieldset {
          width: 100% !important;
          margin: 15px 0;
          padding: 0;
          border: 0;
        }

        .viewer {
          float: none;
          max-width: 160px;
          margin: 0 auto 30px;

          img {
            width: 160px;
          }
        }

        #header-cover-image {
          position: relative;
        }
      }

      .space-action-button {
        ul {
          margin: 0;
          padding: 0;
          list-style: none;

          li {
            margin: 15px 0;
            padding: 12px;
            border: 1px solid var(--se-border-color);
            border-radius: var(--se-border-radius) !important;
            -webkit-transition: box-shadow linear .2s;
            transition: box-shadow linear .2s;

            .space-action-wrap {
              display: -webkit-box;
              display: -ms-flexbox;
              display: flex;
              -webkit-box-align: center;
              -ms-flex-align: center;
              align-items: center;
              -webkit-box-pack: justify;
              -ms-flex-pack: justify;
              justify-content: space-between;
            }

            .space-action-info {
              margin-top: 15px;
              border-top: 1px solid var(--se-border-color);
              padding-top: 15px;

              span, strong {
                display: block;
                margin: 0 0 5px;
              }
            }

            .space-action-label {
              label {
                display: block;
                font-size: 15px;
                font-weight: 600;
              }

              span {
                font-size: 13px;
              }

            }

            .space-action-value {
              input {
                display: inline-block;
                margin-top: 5px;
                outline: 0;
                position: relative !important;
                left: auto;
                border-radius: 100px;
                width: 20px !important;
                height: 20px !important;
                background: #fff;
                cursor: pointer;
                -webkit-transition: all .15s ease-out 0s;
                transition: all .15s ease-out 0s;
              }
            }
          }
        }
      }
    }

    #space-settings-tabs-nav li.active>a, #space-settings-tabs-nav li a:hover, #space-settings-tabs-nav li a:focus {
      background: var(--se-primary-color);
      color: #fff;
      border: 0;
      outline: 0;
    }

    .space-settings-action-wrapper {
      display: none;
    }

    .tab-content {
      display: none;
      transition: all 0.5s ease-in;

      .bp-label-text {
        display: block;
        margin: 15px 0;
      }
    }
  }
}

/**
Create Page Styles
 */
.buddypress-wrap {
  #create-space-form-wrapper {
    .form-group {
      margin-bottom: 20px;
    }

    .bp-feedback {
      margin-bottom: 20px;
    }

    .prev-next {
      height: 40px;
      display: flex;
      justify-content: space-between;
      margin-top: 20px;

      a.button, button {
        line-height: 1.3;
        width: auto;
        font-weight: 500;
        letter-spacing: 0;
        height: 40px;
        min-height: 40px;
        margin: 0;
        padding: 0 20px;
        font-family: inherit;
        color: #fff !important;
        //background-color: var(--global-primary-color);
        font-style: normal;
        text-decoration: none;
        text-align: center;
        cursor: pointer;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        //border: 1px solid var(--global-primary-color);
        //border-radius: var(--global-border-radius) !important;
        outline: 0;
        vertical-align: middle;
        //-webkit-transition: all linear 0.2s;
        //transition: all linear 0.2s;

        &.start {
          float: left;
        }

        &.end {
          float: right;
        }

        &.disabled {
          opacity: .5;
          pointer-events: none;
        }
      }
    }



    .space-create-buttons {
      list-style: none;
      margin: 20px 0 20px;
      padding: 0;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border: 0;

      li {
        font-size: 14px;
        line-height: 1.3;
        font-weight: 600;
        letter-spacing: 0;
        height: 40px;
        min-height: 40px;
        margin: 0;
        padding: 0 20px;
        font-family: inherit;
        //color: #000;
        font-style: normal;
        text-decoration: none;
        text-align: center;
        //border-radius: var(--global-border-radius) !important;
        outline: 0;
        vertical-align: middle;
        //-webkit-transition: all linear 0.2s;
        //transition: all linear 0.2s;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        border: 0;

        &.current {
          //background-color: var(--global-primary-color);
          //color: #fff;
        }
      }
    }

    .create-space-panel {
      //display: none;

      &.current {
        display: block;
      }

      .viewer {
        float: none;
        max-width: 160px;
        margin: 0 auto 30px;

        img {
          width: 160px;
        }
      }

      #header-cover-image {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;

        img {
          margin: 20px 0;
          height: 300px;
        }
      }

      .description {
        text-align: center;
        text-wrap: balance;
      }

      #bp-delete-avatar, #bp-delete-cover-image {
        padding: 0 20px;
      }

      .space-upload-container {
        margin: 20px 0;
        position: relative;

        .drag-drop {
          height: 240px;
        }

        #space_avatar_image, #space_cover_image {
          display: none;
        }

        label {
          position: absolute;
          width: 100%;
          height: 100%;
          cursor: pointer;
          margin: 0 !important;
          padding: 0 !important;
        }

        .space-upload-area {
          box-sizing: border-box;
          margin: 0;
          padding: 15px;
          height: 100%;
          width: 100%;
          background: #fff;
          border: 2px dashed #bbb;
          border-radius: 10px;

          .space-upload-content {
            text-align: center;
            line-height: 40px;
          }
        }
      }
    }
  }
}
