/**
 * Connector Components Styles
 *
 * Styles for Universal Connectors UI components.
 */

/* ============ VendorLogo ============ */

.vendor-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vendor-logo svg {
  width: 100%;
  height: 100%;
}

.vendor-logo--loading {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

/* ============ VendorCard ============ */

.vendor-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all 0.15s ease;
}

.vendor-card--clickable {
  cursor: pointer;
}

.vendor-card--clickable:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.vendor-card--selected {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.vendor-card--configured {
  opacity: 0.8;
}

.vendor-card--compact {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.vendor-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.vendor-card__title {
  flex: 1;
  min-width: 0;
}

.vendor-card__name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.3;
  display: block;
}

.vendor-card__category {
  display: inline-block;
  margin-top: 0.375rem;
  font-size: 0.65rem;
}

.vendor-card__configured-badge {
  flex-shrink: 0;
  margin-left: auto;
}

.vendor-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vendor-card__auth-methods {
  font-size: 0.8rem;
}

.vendor-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-primary);
  text-decoration: none;
}

.vendor-card__link:hover {
  text-decoration: underline;
}

.vendor-card__info {
  flex: 1;
  min-width: 0;
}

.vendor-card__status {
  flex-shrink: 0;
}

/* ============ CategorySection ============ */

.category-section {
  margin-bottom: 1.5rem;
}

.category-section__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  color: var(--color-text);
}

.category-section__header:hover {
  color: var(--color-primary);
}

.category-section__toggle {
  display: flex;
  align-items: center;
  color: var(--color-muted);
}

.category-section__label {
  font-weight: 600;
  font-size: 0.9rem;
}

.category-section__count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.category-section__configured {
  color: var(--color-success);
}

.category-section__content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding-top: 0.75rem;
}

.category-section__content--compact {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

/* ============ AuthMethodSelector ============ */

.auth-method-selector__options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-method-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-method-option:hover {
  border-color: var(--color-primary-light);
}

.auth-method-option--selected {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.auth-method-option__radio {
  padding-top: 0.125rem;
}

.auth-method-option__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  color: var(--color-muted);
}

.auth-method-option--selected .auth-method-option__icon {
  background: var(--color-primary);
  color: white;
}

.auth-method-option__content {
  flex: 1;
  min-width: 0;
}

.auth-method-option__name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.auth-method-option__description {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.auth-method-option__fields {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.auth-method-option__recommended {
  flex-shrink: 0;
  padding: 0.125rem 0.5rem;
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

/* ============ CredentialsForm ============ */

.credentials-form__links {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
}

.credentials-form__link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: var(--color-primary);
  text-decoration: none;
}

.credentials-form__link:hover {
  text-decoration: underline;
}

.credentials-form__input-group {
  display: flex;
  gap: 0.5rem;
}

.credentials-form__input-group .form-control {
  flex: 1;
}

.credentials-form__toggle-visibility {
  flex-shrink: 0;
}

.credentials-form__textarea {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.credentials-form__optional {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.credentials-form__optional-header {
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

/* ============ ConnectorCard ============ */

.connector-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.15s ease;
}

.connector-card:hover {
  box-shadow: var(--shadow-sm);
}

.connector-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.connector-card__title {
  flex: 1;
  min-width: 0;
}

.connector-card__name {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  flex-wrap: wrap;
}

.connector-card__status {
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.connector-card__subtitle {
  margin-top: 0.375rem;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.connector-card__subtitle code {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
}

.connector-card__menu-toggle {
  padding: 0.25rem;
  color: var(--color-muted);
}

.connector-card__menu-toggle::after {
  display: none;
}

.connector-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.75rem;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.connector-card__detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.connector-card__detail-label {
  color: var(--color-muted);
}

.connector-card__detail-value {
  color: var(--color-text);
}

.connector-card__detail code {
  font-size: 0.75rem;
  word-break: break-all;
}

.connector-card__footer {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

/* ============ Page Layouts ============ */

.connector-catalog-page__toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.connector-catalog-page__search {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.connector-catalog-page__filters {
  display: flex;
  gap: 0.5rem;
}

.connector-catalog-page__category-filter {
  min-width: 150px;
}

.connector-catalog-page__categories {
  display: flex;
  flex-direction: column;
}

.connector-create-page__vendor-card {
  background: var(--color-surface-2);
  border: none;
}

.connector-create-page__section {
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.connector-create-page__advanced-toggle {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.connector-create-page__advanced-toggle:hover {
  color: var(--color-text);
}

.connector-create-page__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.universal-connectors-page__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.25rem;
}

/* ============ Animations ============ */

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
