@use '../../../../../shared/styles/settings-shared' as settings;

.main-container {
  width: 100%;
  overflow-y: auto;
}

@include settings.settings-page-header;

.settings-title {
  @include settings.settings-page-title;
  margin-bottom: 0.75rem;
}

.settings-description {
  @include settings.settings-page-description;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
}

.preferences-section {
  @media (min-width: 768px) {
    padding: 0 1rem;
  }
}

.section-header {
  @include settings.settings-section-header;
  margin-top: 1.25rem;
  margin-bottom: 1rem;
}

.section-title {
  @include settings.settings-section-title;
  margin: 0 0 0.5rem 0;
}

.section-description {
  @include settings.settings-section-description;
}

.settings-card {
  @include settings.settings-card;
  gap: 2rem;
}

.setting-item {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 0.5rem 0;

  &:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  @media (max-width: 768px) {
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0;
  }
}

.setting-info {
  flex: 1;
  min-width: 0;

  .setting-label {
    display: block;
    font-weight: settings.$settings-section-title-weight;
    color: var(--p-text-color);
    font-size: settings.$settings-label-size;
    margin-bottom: 0.5rem;
  }

  .setting-label-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;

    .setting-label {
      margin-bottom: 0;
      flex-shrink: 0;
      min-width: 150px;
    }

    .token-input-group {
      flex: 1;
      min-width: 300px;
      max-width: 500px;

      @media (max-width: 768px) {
        min-width: 250px;
        max-width: 100%;
      }
    }
  }

  .setting-description {
    color: var(--p-text-muted-color);
    font-size: settings.$settings-description-size;
    line-height: 1.5;
    margin: 0;
  }
}

.setting-control {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-end;
  min-width: 350px;

  @media (max-width: 768px) {
    align-items: flex-start;
    width: 100%;
    min-width: unset;
  }
}

.token-input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;

  .token-input {
    flex: 1;
    min-width: 200px;

    @media (max-width: 768px) {
      min-width: 150px;
    }
  }

  .token-input-password {
    flex: 1;
    min-width: 200px;

    @media (max-width: 768px) {
      min-width: 150px;
    }
  }
}

.error-message {
  color: var(--p-red-500);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

.access-denied-card {
  @include settings.settings-access-denied-card;
}

.access-denied-content {
  @include settings.settings-access-denied-content;
}
