@layer components {
  .search-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
  }

  .search-bar {
    padding: 12px var(--content-padding);
    flex-shrink: 0;
  }

  .search-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);

    svg {
      color: var(--color-muted);
      flex-shrink: 0;
      width: 16px;
      height: 16px;
    }
  }

  .search-bar-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-normal);
    color: var(--color-text);
    outline: none;

    &::placeholder {
      color: var(--color-muted);
    }
  }

  .search-bar-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: none;
    color: var(--color-muted);
    cursor: pointer;
    flex-shrink: 0;
  }

  /* Shared list item styles */
  .search-result-item,
  .search-recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--content-padding);
    text-decoration: none;
    color: var(--color-text);

    &:active {
      background: var(--color-bg-secondary);
    }

    svg {
      width: 16px;
      height: 16px;
      color: var(--color-muted);
      flex-shrink: 0;
    }
  }

  /* Results */
  .search-results,
  .search-recent-content {
    padding-top: 0;
  }

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

  .search-section-list,
  .search-recent-list {
    display: flex;
    flex-direction: column;
  }

  .search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-caption);
    font-weight: 600;
    color: white;
    flex-shrink: 0;
  }

  .search-result-content {
    flex: 1;
    min-width: 0;
  }

  .search-result-title {
    font-size: var(--text-normal);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-result-subtitle {
    font-size: var(--text-caption);
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Empty state */
  .search-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--color-muted);

    svg {
      width: 48px;
      height: 48px;
      margin-bottom: 1rem;
    }

    h3 {
      font-size: var(--text-normal);
      font-weight: 600;
      color: var(--color-text);
      margin-bottom: 0.25rem;
    }

    p {
      font-size: var(--text-caption);
    }
  }
}
