.parameter-set-form {
  // width: 100%;
  // margin: 0 auto;
  // padding: 20px;
  // background: #f5f5f7;
  // min-height: 100vh;
  margin-left: 20px;


  .remarks-row {
    display: flex;
    align-items: center;
  }

  .add-circle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 120px;
    height: 28px;
    border: 1px solid var(--action-primary-default);
    border-radius: 8px;
    background: transparent;
    color: var(--action-primary-default);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .add-circle-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--action-primary-default);
  }

  .add-circle-text {
    font-family: Helvetica !important;
    font-weight: 400;
    font-size: 12px;
    line-height: 150%;
  }

  .FormOverView {
    width: 100%;
  }

  .FormSection {
    overflow: hidden; // Prevent outer scroll

    &.scrollbar {
      &::-webkit-scrollbar {
        width: 8px;
      }

      &::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
      }

      &::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;

        &:hover {
          background: #a8a8a8;
        }
      }
    }
  }

  .content-card {
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;

    mat-card-content {
      height: 100%;
      display: flex;
      flex-direction: column;
    }

    .parameter-tabs {
      height: 100%;
      display: flex;
      flex-direction: column;

      ::ng-deep {
        .mat-mdc-tab-header {
          background-color: transparent !important;
          position: sticky;
          top: 0;
          z-index: 10;
          background: white !important;
        }

        .mat-mdc-tab-body-wrapper {
          flex: 1;
          overflow: hidden;
        }

        .mat-mdc-tab-body-content {
          overflow: hidden;
          height: 100%;
        }

        .mat-mdc-tab-list {
          flex-grow: 0 !important;
        }
      }

      // Tab content wrapper
      .tab-content-wrapper {
        height: 100%;
        display: flex;
        flex-direction: column;
      }

      .tab-content {
        height: 100%;
        display: flex;
        flex-direction: column;

        // Fixed section header
        .section-header {
          position: sticky;
          top: 0;
          z-index: 5;
          background: white;
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 16px 24px;
          margin: 0;

          h2 {
            margin: 0;
            font-family: Helvetica !important;
            font-weight: 700;
            font-style: Bold;
            font-size: 18px;
            line-height: 150%;
            letter-spacing: 0%;
            vertical-align: middle;
            color: #1A1A1ADE;
          }

          .tab-actions {
            display: flex;
            gap: 8px;
          }
        }

        // Scrollable parameters area
        .parameters-scrollable {
          flex: 1;
          overflow-y: auto;
          overflow-x: hidden;

          &::-webkit-scrollbar {
            width: 8px;
          }

          &::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
          }

          &::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 4px;

          }
        }

        .parameters-container {
          display: grid;
          gap: 16px;

          .parameter-card {
            border-radius: 8px;
            padding: 16px;
            transition: all 0.3s ease;

            &:hover {
              box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            }

            &.selected {
              background: #ffffff;
              border: 2px solid var(--action-primary-default, #667eea);
            }

            .parameter-content {
              .parameter-header {
                display: flex;
                justify-content: space-between;
                align-items: flex-start;
                margin-bottom: 8px;

                .parameter-title {
                  margin: 0;
                  font-size: 16px;
                  font-weight: 600;
                  color: #2c3e50;
                  flex: 1;
                }

                .delete-btn {
                  color: #6c757d;
                  transition: all 0.3s ease;

                  &:hover {
                    color: #dc3545;
                    background: rgba(220, 53, 69, 0.1);
                    transform: scale(1.1);
                  }

                  mat-icon {
                    font-size: 20px;
                    width: 20px;
                    height: 20px;
                  }
                }
              }

              .parameter-description {
                margin: 0;
                font-size: 14px;
                color: #6c757d;
                line-height: 1.5;
              }
            }
          }
        }
      }
    }
  }

  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);

    &[style*="display: flex"] {
      display: flex !important;
    }
  }

  .modal-content {
    background: #FFFFFF;
    width: 686px;
    height: 210px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;

    h3 {
      margin: 0;
      font-family: Helvetica !important;
      font-size: 20px;
      font-weight: 600;
      color: var(--action-primary-default, #667eea);
      line-height: 1.2;
    }

    .close-btn {
      background: transparent;
      border: none;
      cursor: pointer;
      padding: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: background-color 0.2s ease;

      &:hover {
        background: rgba(0, 0, 0, 0.05);
      }

      mat-icon {
        font-size: 24px;
        width: 24px;
        height: 24px;
        color: #1A1A1ADE;
      }
    }
  }

  .modal-body {
    padding: 12px;

    .content-row {
      display: flex;
      gap: 20px;
      align-items: flex-start;

      .description-text {
        flex: 1;

        p {
          font-family: Helvetica !important;
          font-weight: 400;
          font-style: Regular;
          font-size: 12px;
          line-height: 150%;
          letter-spacing: 0%;
          color: #1A1A1ADE;
        }
      }
    }
  }

  .modal-footer {
    padding: 4px 24px 24px 24px;

    .save-button {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 24px;
      border-radius: 6px;
      font-family: Helvetica, Arial, sans-serif;
      font-size: 14px;
      font-weight: 500;
      text-transform: none;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      transition: all 0.2s ease;

      &:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
      }

      mat-icon {
        font-size: 18px;
        width: 18px;
        height: 18px;
      }
    }
  }

  .parameters-container::-webkit-scrollbar,
  .modal-content::-webkit-scrollbar {
    width: 8px;
  }

  .parameters-container::-webkit-scrollbar-track,
  .modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }

  .parameters-container::-webkit-scrollbar-thumb,
  .modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;

    &:hover {
      background: #a8a8a8;
    }
  }
}

@media (max-width: 1024px) {
  .parameter-set-form {
    margin-left: 8px;

    .form-container > div[style*="1350px"] {
      width: 100% !important;
      height: auto !important;
      box-sizing: border-box;
      padding: 12px 16px;
    }

    .form-container > div[style*="1350px"] > div[style*="display: flex"] {
      flex-wrap: wrap;
      gap: 8px;

      gb-newpicklist {
        flex: 1 1 240px;
        min-width: 200px;
        height: auto !important;
        max-height: 72px;
        overflow: visible;
      }
    }

    .remarks-row {
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;

      .add-circle-btn {
        margin-left: 0 !important;
      }
    }

    .content-card .parameter-tabs {
      ::ng-deep .mat-mdc-tab-label {
        min-width: 80px;
        padding: 0 10px;
      }
    }
  }
}

@media (max-width: 768px) {
  .parameter-set-form {
    margin-left: 0;
    padding: 8px;

    .form-container > div[style*="1350px"] {
      width: 100% !important;
      height: auto !important;
      border-radius: 8px;
      padding: 12px 12px 16px 12px;
      box-sizing: border-box;
      margin-bottom: 8px;
    }

    .form-container > div[style*="1350px"] > div[style*="display: flex"] {
      flex-direction: column;
      gap: 12px; 

      gb-newpicklist {
        display: block;
        width: 100% !important;
        margin-left: 0 !important;
        height: 56px !important;
        max-height: 56px !important;
        overflow: visible !important; 
        box-sizing: border-box;

        ::ng-deep {
          .mat-mdc-form-field,
          .mat-mdc-text-field-wrapper,
          .mdc-text-field {
            height: 56px !important;
            max-height: 56px !important;
          }
        }
      }
    }

    .remarks-row {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
      margin-top: 12px; 

      gb-input {
        width: 100%;
        display: block;
      }

      div[style*="margin-left: 50px"],
      div[style*="margin-left:50px"] {
        margin-left: 0 !important;
        width: 100%;
      }

      .add-circle-btn {
        width: 100%;
        justify-content: center;
        height: 36px;
      }
    }

    .FormSection {
      height: auto !important;
      max-height: calc(100vh - 300px) !important;
      overflow-y: auto;
    }

    .content-card {
      border-radius: 8px;

      .parameter-tabs .tab-content {

        .section-header {
          flex-direction: column;
          align-items: flex-start;
          gap: 6px;
          padding: 10px 14px;

          h2 {
            font-size: 15px;
            margin: 0;
          }

          .tab-actions {
            align-self: flex-end;
          }
        }

        .parameters-container {
          gap: 10px;

          .parameter-card {
            padding: 12px;

            .parameter-content {
              .parameter-header .parameter-title {
                font-size: 14px;
              }
              .parameter-description {
                font-size: 13px;
              }
            }
          }
        }
      }

      ::ng-deep .mat-mdc-tab-header {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;

        &::-webkit-scrollbar { display: none; }

        .mat-mdc-tab-list {
          flex-wrap: nowrap !important;
        }

        .mat-mdc-tab-label {
          min-width: 70px;
          padding: 0 8px;
          font-size: 12px;
          white-space: nowrap;
        }
      }
    }

    .modal-content {
      width: calc(100vw - 24px) !important;
      height: auto !important;
      max-height: 90vh;
      overflow-y: auto;
      border-radius: 8px;
    }

    .modal-body .content-row {
      flex-direction: column;
      gap: 12px;

      .description-text {
        width: 100%;
      }

      .input-field {
        width: 100%;
        margin-top: 0 !important;

        gb-newpicklist {
          display: block;
          width: 100%;
          height: 56px !important;
          max-height: 56px !important;
          overflow: visible !important;
        }

        gb-input {
          width: 100%;
        }
      }
    }

    .modal-footer {
      padding: 8px 16px 16px;

      .save-button {
        width: 100%;
        justify-content: center;
      }
    }
  }
}

@media (max-width: 480px) {
  .parameter-set-form {
    padding: 4px;

    .FormSection {
      max-height: calc(100vh - 340px) !important;
    }

    .form-container > div[style*="1350px"] > div[style*="display: flex"] {
      gap: 10px; 

      gb-newpicklist {
        height: 52px !important;
        max-height: 52px !important;
      }
    }

    .modal-header h3 {
      font-size: 16px;
    }

    .content-card .parameter-tabs .tab-content {
      .section-header h2 {
        font-size: 13px;
      }

      .parameters-container .parameter-card {
        padding: 10px;

        .parameter-content .parameter-header .parameter-title {
          font-size: 13px;
        }
      }
    }

    ::ng-deep .mat-mdc-tab-label {
      min-width: 60px !important;
      padding: 0 6px !important;
      font-size: 11px !important;
    }
  }
}