@use 'variables' as *;
@use 'mixins' as *;

$zwssgrgeneral: ".zwssgr";

#{$zwssgrgeneral} {
    &-page-title {
        font-size: var(--font-size-h2);
        font-weight: var(--font-weight-600);
        color: var(--body-color);
        font-family: var(--font-primary);
        border-bottom: 1px solid rgba(16, 41, 50, 0.10);
        padding-bottom: 20px;
    }

    &-notice {
        border: 1px solid var(--gray-color-100);
        border-left-width: 4px;
        padding: 15px;
        margin: 10px 0;
        position: sticky;
        top: 5%;
        z-index: 99;
        border-radius: var(--border-radius);
    }
    
    &-notice-success {
        border-left-color: var(--success-color);
        background: var(--success-color-200);
        color: var(--success-color-100);
    }
    
    &-notice-error {
        border-left-color: var(--red-color);
        background: var(--red-color-200);
        color: var(--red-color-100);
    } 
    
    
    &-notice p {
        margin: 0;
    }
    
    &-email-error{
        color: var(--red-color);
        display: none;
    }
    
    &-email-success{
        color: var(--success-color-100);
        display: none;
    }
    
    &-keyword-error-message{
        display: none;
        color: var(--red-color);
    }
    
    &-success-message{
        margin-bottom: 10px;
        color: var(--success-color-100);
    }

    &-load-more-btn {
        background-color: var(--black-color);
        color: var(--white-color);
        padding: 10px 20px;
        text-align: center;
        margin: 0 auto;
        display: block;
        cursor: pointer;
        font-size: var(--font-size-body);
        border: none;
        line-height: inherit;
    }

    &-no-found-message{
        padding: 20px;
        text-align: center;
        font-size: var(--font-size-h2);
        text-transform: capitalize;
        width: 100%;
    }

    &-keywords-list {
        margin-top: 10px;
        #{$zwssgrgeneral} {
            &-keyword-item {
                display: inline-block;
                background-color: var(--gray-color-200);
                border-radius: var(--border-radius-5);
                padding: 5px;
                margin: 5px;
            }
            &-remove-keyword {
                cursor: pointer;
                color: var(--red-color);
                margin-left: 5px;
            }
        }
    }

    &-main-div-wrapper {
        max-width: 100%;
        margin-top: 20px;
    }

    &-main-wrapper {
        max-width: 100%;
        #{$zwssgrgeneral} {
            &-toogle-display {
                background-color: transparent;
            }
        }
    }

    &-front-review-filter-wrap {
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;

        #{$zwssgrgeneral} {
            &-widget-setting-font {
                display: flex;
                justify-content: flex-end;
                align-items: center;
                flex-wrap: wrap;

                @include respond-below('sm') {
                    width: 100%;
                    padding-left: 0;
                    justify-content: flex-start;
                    margin-bottom: 20px;
                }
            }
            &-front-keyword-list {
                border-radius: var(--border-radius-extra-small);
                display: flex;
                justify-content: flex-end;
                align-items: center;
                flex-wrap: wrap;
                padding-left: 20px;

                ul {
                    list-style-type: none;
                    padding: 0;
                    margin: 0;
                    display: flex;
                    flex-wrap: wrap;

                    li {
                        background-color: var(--white-color);
                        border: 1px solid var(--gray-color-200);
                        padding: 5px 20px;
                        margin: 5px;
                        border-radius: var(--border-radius-18);
                        font-size: var(--font-size-body);
                        color: var(--black-color);
                        cursor: pointer;

                        &.selected {
                            background-color: var(--gray-color-200);
                        }
                    }
                }

                @include respond-below('sm') {
                    width: 100%;
                    padding-left: 0;
                    justify-content: flex-start;
                    margin-bottom: 20px;
                }
            }
            &-label-font {
                font-size: var(--font-size-h2);
                font-weight: var(--font-weight-500);
                line-height: 1;
                margin: 0;
                margin-right: 10px;
            }
            &-input-text {
                padding: 10px 30px 10px 16px;
                border: 1px solid var(--gray-color-300);
                height: 48px;
                box-shadow: none;
                color: var(--charcoal-gray);
                border-radius: var(--border-radius-large);
                font-weight: var(--font-weight-400);
                width: auto;
                font-size: var(--font-size-body);
                font-family: var(--font-primary);
                line-height: 1.4;
                background: var(--white-color-200) url(../../images/down-arrow.png) no-repeat right 7px top 55%;
                background-size: 16px 10px;
                appearance: none;
                -webkit-appearance: none;
                -moz-appearance: none;
            }
        }
    }

    &-generated-shortcode-display {
        margin-top: 20px;
        padding: 10px;
        background-color: var(--gray-color-200);
        border: 1px solid var(--gray-color-100);
        font-size: var(--font-size-h2);
    }

    &-shortcode {
        display: flex;
        align-items: center;
    }

    &-widget-settings {
        box-shadow: 0px 0.5px 2px 0px var(--extra-dark-secondary-color);
        padding: 1rem;
        background-color: var(--white-color);
        border-radius: var(--border-radius-12);
        margin-bottom: 20px;
    }

    &-label,
    &-setting-form th, 
    &-th {
        font-size: var(--font-size-body);
        font-weight: var(--font-weight-500);
        font-family: var(--font-primary);
        line-height: 1.6;
        color: var(--secondary-color-100);
    }

    &-description {
        font-size: var(--font-size-14);
        font-weight: var(--font-weight-400);
        font-family: var(--font-primary);
        color: var(--secondary-color-100);
        margin-top: 5px;
    }

    &-keyword-error-message {
        display: none;
        color: var(--red-color);
    }

    &-switch {
        position: relative;
        display: inline-block;
        width: 60px;
        height: 34px;

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

    &-toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--gray-color-100);
        transition: .4s;
        border-radius: var(--border-radius-34);

        &::before {
            position: absolute;
            content: "";
            height: 26px;
            width: 26px;
            left: 4px;
            bottom: 4px;
            background-color: var(--white-color);
            transition: .4s;
            border-radius: 50%;
        }
    }

    &-google-toggle {
        padding: 10px 20px;
        font-size: var(--font-size-body);
        text-decoration: none;
        border: none;
        display: inline-block;
    }

   

    &-input-check {
        &:checked + .zwssgr-toggle-slider {
            background-color: var(--secondary-color);
            &::before {
                transform: translateX(26px);
            }
        }
    }

    &-color-options,
    &-color-options_load {
        display: flex;
        margin-top: 10px;

        #{$zwssgrgeneral} {
            &-color-picker,
            &-color-picker-load {
                margin-right: 25px;
                display: flex;
                align-items: center;

                label {
                    padding-right: 10px;
                }
            }
        }
    }

    &-sort-by-checkbox {
        padding-top: 10px;
        #{$zwssgrgeneral} {
            &-chechbox-label {
                font-size: var(--font-size-14);
            }
        }
    }

    &-tooltip {
        position: relative;
    }

    &-tooltip-container {
        width: 20px;
        height: 20px;
        position: absolute;
        left: 500px;
        top: 50%;
        transform: translateY(-50%);
        display: inline-block;
        padding-left: 10px;

        svg {
            width: 20px;
            height: 20px;
        }

        &:hover {
            #{$zwssgrgeneral} {
                &-tooltip-text { 
                    visibility: visible;
                    opacity: 1;
                }
            }
        }
    }

    &-tooltip-text {
        visibility: hidden;
        width: 160px;
        background-color: var(--black-color);
        color: var(--white-color);
        text-align: center;
        border-radius: var(--border-radius-5);
        padding: 5px;
        position: absolute;
        z-index: 1;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    &-dashboard {
        #{$zwssgrgeneral} {
            &-input-text {
                padding: 10px 16px;
                border: 1px solid var(--gray-color-300);
                background: var(--white-color-200);
                height: 48px;
                box-shadow: none;
                color: var(--charcoal-gray);
                border-radius: var(--border-radius-large);
                font-weight: var(--font-weight-400);
                font-size: var(--font-size-body);
                font-family: var(--font-primary);
                line-height: 1;
                width: 100%;
                max-width: 500px;
            }
        
            &-input-select {
                line-height: 1.3;
                background: var(--white-color-200) url(../../images/down-arrow.png) no-repeat right 7px top 55%;
                background-size: 16px 10px;
            }

            &-textarea {
                padding: 10px 16px;
                border: 1px solid var(--gray-color-300);
                background: var(--white-color-200);
                height: 200px;
                box-shadow: none;
                color: var(--charcoal-gray);
                border-radius: var(--border-radius-large);
                font-weight: var(--font-weight-400);
                font-size: var(--font-size-body);
                font-family: var(--font-primary);
                line-height: 1;
                width: 100%;
            }

            &-checkbox {
                width: 16px;
                height: 16px;
                border-radius: var(--border-radius);
                border: 1px solid var(--gray-color-100);
                background: var(--white-color);
                &:checked {
                    background-color: var(--primary-color-100);
                    border: 1px solid var(--secondary-color);
                    border-radius: var(--border-radius);
        
                    &::before {
                        content: url(../../images/checked-icon.png);
                        display: flex;
                        align-items: center;
                        align-content: center;
                        justify-content: center;
                        height: 14px;
                        width: 14px;
                        margin: 0;
                    }
                }
            }
        }
    
    }
   
    &-chechbox-label {
        font-size: var(--font-size-body);
        font-weight: var(--font-weight-400);
        font-family: var(--font-primary);
        line-height: 1;
    }

    &-widget-wrap {
        display: flex;
        flex-wrap: wrap;
        gap: 30px;
        #{$zwssgrgeneral} {
            &-widget-setting {
                width: 45%;

                @include mobile() {
                    width: 100%;
                }
            }

            &-setting-star {
                cursor: pointer;
                display: inline-block;
                margin: 5px;
                transition: fill 0.2s ease;
            }

            &-widget-eleemt-list {
                display: flex;
                justify-content: flex-start;
                flex-wrap: wrap;
                padding: 0;
                margin: 0;

                li {
                    padding: 0 0 20px 0;
                    margin: 0;
                    width: 33.33%;
                }
            }
        }
    }


}

.keyword-item {
    display: inline-block;
    background-color: var(--gray-color-200);
    border-radius: var(--border-radius-5);
    padding: 5px;
    margin: 5px;
}

.remove-keyword {
    cursor: pointer;
    color: var(--red-color);
    margin-left: 5px;
}

/* Help and Support Page Design (aligned with product reference UI) */

.zwssgr-help-wrapper {
  max-width: 100%;
}

.zwssgr-help-page {
  margin-top: 24px;

  .zwssgr-page-subtitle {
    margin-bottom: 24px;
    max-width: 1140px;
    line-height: 20px;
    font-size: 14px;
    color: #50575e;
  }

  .primary-btn {
    @extend .zwssgr-primary-btn;

    &:hover,
    &:focus {
      background: #005a87;
      color: #fff !important;
    }
  }
}

.zwssgr-help-top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;

  .zwssgr-help-card {
    .zwssgr-help-card-title {
      font-size: 20px;
      line-height: 40px;
    }
  }
}

.zwssgr-help-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.zwssgr-help-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eef0f2;
  padding: 24px;
  min-height: 255px;
  display: flex;
  flex-direction: column;

  &-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    line-height: 0;

    svg {
      display: block;
      max-width: 100%;
      max-height: 100%;
    }
  }

  &-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 500;
    color: #1d2327;
    line-height: 1.35;
  }

  &-text {
    margin: 0;
    color: #4a494b;
    line-height: 20px;
    font-size: 14px;
  }

  &-footer {
    margin-top: auto;
    padding-top: 18px;

    > .zwssgr-primary-btn,
    > .primary-btn {
      float: right;
    }

    &::after {
      content: '';
      display: table;
      clear: both;
    }
  }

  &-wide {
    min-height: 338px;

    .zwssgr-help-card-title {
      font-size: 20px;
      line-height: 28px;
      margin-bottom: 8px;
    }
  }
}

.zwssgr-help-newsletter {
  &-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #50575e;
    line-height: 20px;

    .zwssgr-help-required {
      color: #e10a3e;
      margin-left: 3px;
    }
  }

  &-input {
    width: 100%;
    height: 40px;
    background: #fff;
    border: 1px solid #9cd8ea;
    border-radius: 8px;
    padding: 0 12px;
    margin-bottom: 12px;
    box-sizing: border-box;

    &::placeholder {
      color: #9aa1ab;
    }

    + .zwssgr-primary-btn,
    + .primary-btn {
      float: right;
    }
  }

  &-embed {
    margin-top: 4px;

    .gfiframe {
      max-width: 100%;
    }
  }
}

.zwssgr-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #285064;
  color: #fff !important;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  line-height: 1.3;
  box-shadow: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;

  &:hover,
  &:focus {
    background: #0074A2;
    color: #fff !important;
  }

  &-icon {
    display: inline-flex;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    min-width: 14px;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 0;
    margin: 0;
    vertical-align: middle;

    svg {
      display: block;
      width: 14px;
      height: 14px;
    }
  }
}

.zwssgr-help-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;

  li {
    background: #fff;
    border: 1px solid #eff1f4;
    border-radius: 8px;
    padding: 14px 16px 14px 22px;
    position: relative;

    &::before {
      content: '';
      position: absolute;
      left: 10px;
      top: 20px;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #0f9ac8;
    }
  }

  a {
    color: #007ab0;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-decoration: none;

    &:hover,
    &:focus {
      text-decoration: underline;
    }
  }
}

.zwssgr-help-faq {
  &-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  &-item {
    background: #fff;
    border: 1px solid #e7edf1;
    border-radius: 8px;
    overflow: hidden;

    &.is-open {
      border-color: #6fc2dd;

      .zwssgr-help-faq-answer {
        max-height: 2000px;
        opacity: 1;
        padding: 0 16px 14px;
      }
    }

    button {
      outline: none !important;
    }
  }

  &-question {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    color: #056d99;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    text-align: left;
    margin: 0;
    box-shadow: none;

    span {
      font-size: 24px;
      line-height: 1;
      color: #4b5b66;
    }
  }

  &-answer {
    padding: 0 16px 0;
    color: #4a494b;
    line-height: 20px;
    font-size: 14px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.2s ease;
  }
}

/* Responsive */
@media screen and (max-width: 1200px) {
  .zwssgr-help-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 960px) {
  .zwssgr-help-top-grid,
  .zwssgr-help-bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* Legacy */
.zwssgr-card-grid,
.zwssgr-lower-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.zwssgr-lower-grid {
  grid-template-columns: 1fr 1fr;
}

.zwssgr-card {
  background: #fff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);

  h2 {
    margin-top: 0;
  }

  input[type="email"] {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
  }
}

.zwssgr-blog-list {
  padding-left: 20px;

  li {
    margin-bottom: 10px;
  }
}

.zwssgr-faq-item {
  border: 1px solid #e2e2e2;
  margin-bottom: 10px;
  border-radius: 6px;

  &.active {
    .zwssgr-faq-answer {
      display: block;
    }
  }
}

.zwssgr-faq-question {
  padding: 12px;
  cursor: pointer;
  font-weight: 600;
}

.zwssgr-faq-answer {
  padding: 12px;
  display: none;
}
