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

.main-container {
  @include settings.settings-page-container;
}

@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;
}

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

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

  .section-description {
    @include settings.settings-section-description;
    margin: 0.5rem 0 0 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;

    .pi {
      color: var(--p-primary-color);
      margin-top: 0.125rem;
      flex-shrink: 0;
    }
  }
}

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

.settings-card {
  @include settings.settings-card;

  app-metadata-advanced-fetch-options {
    display: block;
    width: 100%;

    ::ng-deep {
      > div,
      > .container,
      > .main-container {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
      }
    }
  }
}

:host ::ng-deep {
  .p-accordion {
    .p-accordion-panel {
      margin-bottom: 0.5rem;
      border: 1px solid var(--p-content-border-color);
      border-radius: 6px;
      overflow: hidden;

      &:last-child {
        margin-bottom: 0;
      }
    }

    .p-accordion-header {
      background: var(--p-surface-100);
      border: none;
      border-radius: 0;

      &:hover {
        background: var(--p-surface-200);
      }

      .p-accordion-header-content {
        width: 100%;
        padding: 1rem 1.25rem;
        display: flex;
        align-items: center;
      }
    }

    .p-accordion-content {
      border: none;
      border-top: 1px solid var(--p-content-border-color);

      .p-accordion-content-content {
        padding: 0;
      }
    }
  }
}

.accordion-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;

  @media (max-width: 768px) {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

.sidecar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;

  @media (max-width: 768px) {
    width: 100%;
    justify-content: flex-start;
  }
}

.library-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  .library-icon {
    font-size: 1.2rem;
    color: var(--p-primary-color);
  }

  .library-name {
    font-weight: settings.$settings-section-title-weight;
    color: var(--text-color);
  }

  .dot-separator {
    color: var(--p-text-muted-color);
    font-weight: bold;
    font-size: settings.$settings-section-description-size;
    margin: 0 0.25rem;
    opacity: 0.6;
  }

  .override-indicator,
  .default-indicator {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: settings.$settings-section-description-size;
    font-weight: settings.$settings-label-weight;

    &.custom {
      color: var(--p-green-500);
    }

    &.default {
      color: var(--p-blue-500);
    }

    i {
      font-size: settings.$settings-section-description-size;
    }
  }
}

.accordion-content-wrapper {
  padding: 1.5rem;

  app-metadata-advanced-fetch-options {
    display: block;
    width: 100%;

    ::ng-deep {
      > div,
      > .container,
      > .main-container {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
      }
    }
  }
}
